groupLifecyclePolicy: renewGroup
-
- 2 minutes to read
-
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.
Renews a group's expiration. When a group is renewed, the group expiration is extended by the number of days defined in the policy.
Note: In V1.0, use the group resource to make renew requests.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type |
Permissions (from least to most privileged) |
Delegated (work or school account) |
Group.ReadWrite.All or Directory.ReadWrite.All |
Delegated (personal Microsoft account) |
Not supported |
Application |
Group.ReadWrite.All or Directory.ReadWrite.All |
HTTP request
POST /groupLifecyclePolicies/renewGroup
Name |
Description |
Authorization |
Bearer {token}. Required. |
Content-Type |
application/json |
Request body
In the request body, provide a JSON object with the following parameters.
Parameter |
Type |
Description |
groupId |
Guid |
The id of the group to renew. |
Response
If successful, this method returns 204 No Content
response code. It does not return anything in the response body.
Example
Request
POST https://graph.microsoft.com/beta/groupLifecyclePolicies/renewGroup
Content-type: application/json
Content-length: 57
{
"groupId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var groupId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
await graphClient.GroupLifecyclePolicies
.RenewGroup(groupId)
.Request()
.PostAsync();
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
const options = {
authProvider,
};
const client = Client.init(options);
const _boolean = {
groupId: "ffffffff-ffff-ffff-ffff-ffffffffffff"
};
let res = await client.api('/groupLifecyclePolicies/renewGroup')
.version('beta')
.post(_boolean);
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groupLifecyclePolicies/renewGroup"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSMutableDictionary *payloadDictionary = [[NSMutableDictionary alloc] init];
NSString *groupId = @"ffffffff-ffff-ffff-ffff-ffffffffffff";
payloadDictionary[@"groupId"] = groupId;
NSData *data = [NSJSONSerialization dataWithJSONObject:payloadDictionary options:kNilOptions error:&error];
[urlRequest setHTTPBody:data];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
Response
HTTP/1.1 204 No Content