I am trying to use a Graph API call in a Flow that will assign a license when a new user is created. I am trying to build out the license assignment, and I am getting the error "error": { "code": "Request_BadRequest", "message": "Specified HTTP method is not allowed for the request target.",
I am not sure what is incorrect. The application I have being used had ReadWrite.All permissions for both Directory and Users. Here is the full JSON output and input.
Any ideas?
Input:
{
"uri": "https://graph.microsoft.com/v1.0/users/67a9cbf3-d55b-47b3-b0d2-be1ba01f683d/assignedLicenses",
"method": "POST",
"authentication": {
"authority": "https://login.microsoftonline.com",
"tenant": "Tenant ID",
"audience": "https://graph.microsoft.com",
"clientId": "Secret ID",
"secret": "*sanitized*",
"type": "ActiveDirectoryOAuth"
},
"body": {
"addLicenses": [
{
"disabledPlans": [],
"skuId": "f30db892-07e9-47e9-837c-80727f46fd3d"
},
{
"disabledPlans": [],
"skuId": ""
}
],
"removeLicenses": []
}
}
Output:
{
"statusCode": 405,
"headers": {
"Cache-Control": "no-cache",
"Transfer-Encoding": "chunked",
"Vary": "Accept-Encoding",
"Strict-Transport-Security": "max-age=31536000",
"request-id": "fe8722cd-c0ab-462b-aa01-4271924efb28",
"client-request-id": "fe8722cd-c0ab-462b-aa01-4271924efb28",
"x-ms-ags-diagnostic": "{"ServerInfo":{"DataCenter":"West US","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"BY1PEPF00003AA0"}}",
"x-ms-resource-unit": "1",
"Date": "Thu, 09 May 2024 20:25:32 GMT",
"Content-Type": "application/json",
"Content-Length": "267"
},
"body": {
"error": {
"code": "Request_BadRequest",
"message": "Specified HTTP method is not allowed for the request target.",
"innerError": {
"date": "2024-05-09T20:25:33",
"request-id": "fe8722cd-c0ab-462b-aa01-4271924efb28",
"client-request-id": "fe8722cd-c0ab-462b-aa01-4271924efb28"
}
}
}
}
I expect and license to be assigned to the user, but I am getting a Request_BadRequest error