Support for Assigning User Licenses in Microsoft G

2019-08-26 08:25发布

问题:

When will support for assigning user licenses in O365 be added for the Microsoft Graph API? Currently in version 1.0, I get the following error when trying to assign a license,

{
  "error": {
    "code": "Request_BadRequest",
    "message": "Property 'assignedLicenses' is read-only and cannot be set.",
    "innerError": {
      "request-id": "0827887a-4e46-48d6-93c6-81825aeaac61",
      "date": "2017-06-16T18:35:29"
    }
  }
}

Will this be supported in version 2.0? If so, is there a timeframe it will be added?

回答1:

Assigning licenses is supported, but not through updating the property. This property is indeed read only. We should improve our error message here to indicate how this can be set - sorry about that.

What you need to do is use the assignLicense method. The info is here: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_assignlicense. Please let me know if you have any further challenges using this method.

Hope this helps,