Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm running the following API requests:
curl -X POST https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/<device-id>/locateDevice -H "Accept: application/json" -H "Authorization: <XX_REPLACED>" -H "Content-Type: application/json"curl -X POST https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/<device-id>/recoverPasscode -H "Accept: application/json" -H "Authorization: <XX_REPLACED>" -H "Content-Type: application/json"Similarly for:
deviceManagement/managedDevices/<device-id>/disableLostModedeviceManagement/managedDevices/<device-id>/shutDownAnd I'm receiving the following error:
{
"error": {
"code": "BadRequest",
"message": "{\r\n \"_version\": 3,\r\n \"Message\": \"An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: <XXX> - Url: https://fef.amsub0202.manage.microsoft.com/DeviceFE/StatelessDeviceFEService/deviceManagement/managedDevices('<device_id>')/microsoft.management.services.api.locateDevice?api-version=2023-07-04\",\r\n \"CustomApiErrorPhrase\": \"\",\r\n \"RetryAfter\": null,\r\n \"ErrorSourceService\": \"\",\r\n \"HttpHeaders\": \"{}\"\r\n}",
"innerError": {
"date": "2024-01-31T13:08:41",
"request-id": "<XXX>",
"client-request-id": "<XXX>"
}
}
}
In contrast, when I execute the deviceManagement/managedDevices/<device-id>/syncDevice API request on the same device_id, I see that it works as expected, and I receive a successful response with status code 204.
I have all the required permissions for these commands
Could someone explain why some commands are not working?