APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Caution
The activateServicePlan API is deprecated and will stop returning data on June 30, 2022.
Activate a service plan with a given servicePlanId and skuId for a given user.
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 most to least privileged)
Delegated (work or school account)
Directory.ReadWrite.All
Delegated (personal Microsoft account)
Not Supported.
Application
Directory.ReadWrite.All
HTTP request
POST /users/{id | userPrincipalName}/activateServicePlan
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-Type
application/json. Required.
Request body
In the request body, provide a JSON object with the following parameter:
Parameter
Type
Description
servicePlanId
Guid
PlanId of the ServicePlan to activate.
skuId
Guid
SkuId of SKU the service plan is on.
Response
If successful, this action returns a 204 No Content response code.
POST https://graph.microsoft.com/beta/me/activateServicePlan
Content-type: application/json
{
"servicePlanId": "28f42d6f-8034-4a0f-9d8a-a218a63b3299",
"skuId": "465a2a90-5e59-456d-a7b8-127b9fb2e484"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var servicePlanId = Guid.Parse("28f42d6f-8034-4a0f-9d8a-a218a63b3299");
var skuId = Guid.Parse("465a2a90-5e59-456d-a7b8-127b9fb2e484");
await graphClient.Me
.ActivateServicePlan(servicePlanId,skuId)
.Request()
.PostAsync();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := graphmodels.NewActivateServicePlanPostRequestBody()
servicePlanId := uuid.MustParse("28f42d6f-8034-4a0f-9d8a-a218a63b3299")
requestBody.SetServicePlanId(&servicePlanId)
skuId := uuid.MustParse("465a2a90-5e59-456d-a7b8-127b9fb2e484")
requestBody.SetSkuId(&skuId)
graphClient.Me().ActivateServicePlan().Post(requestBody)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Import-Module Microsoft.Graph.Users.Actions
$params = @{
ServicePlanId = "28f42d6f-8034-4a0f-9d8a-a218a63b3299"
SkuId = "465a2a90-5e59-456d-a7b8-127b9fb2e484"
}
# A UPN can also be used as -UserId.
Initialize-MgUserServicePlan -UserId $userId -BodyParameter $params
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.