Hi everyone,
I am trying to assign licenses to new employees using the Microsoft Graph API in Power Automate. I can retrieve licenses using GET, but I cannot assign them to new employees using POST or PATCH. I get the error "Method Not Allowed."
I have tried the following:
- I have tried using the POST and PATCH methods to assign licenses to new employees.
- I am using a tenant administrator account.
- I have enabled the Microsoft Graph API for my tenant.
- I have granted the necessary permissions to the Power Automate flow.
{
"uri": "https://graph.microsoft.com/v1.0/users/mkolaric@cizici.onmicrosoft.com/assignedLicenses",
"method": "POST",
"headers": {
"Content-type": "application/json"
},
"authentication": {
"authority": "",
"tenant": "02447283-2aae-4f75-9b89-ce366e9782e9",
"audience": "https://graph.microsoft.com",
"clientId": "62dbfa9c-dd6d-4d75-8c53-06fc754c3f03",
"secret": "*sanitized*",
"type": "ActiveDirectoryOAuth"
},
"body": {
"value": [
{
"addLicenses": [
{
"disabledPlans": [],
"skuId": "5b631642-bd26-49fe-bd20-1daaa972ef80"
},
{
"disabledPlans": [],
"skuId": "c42b9cae-ea4f-4ab7-9717-81576235ccac"
}
],
"removeLicenses": []
}
]
}
}
{
"error": {
"code": "Request_BadRequest",
"message": "Specified HTTP method is not allowed for the request target.",
"innerError": {
"date": "2024-03-19T08:42:48",
"request-id": "f1b1c2cc-f83b-4a91-b4bc-88352d61bb50",
"client-request-id": "f1b1c2cc-f83b-4a91-b4bc-88352d61bb50"
}
}
}
Has anyone else experienced this issue? How can I assign licenses to new employees using the Microsoft Graph API in Power Automate?