Bad Request Response for Microsoft Intune Device Actions - api

Our company using Microsoft Graph API to retrieve data about devices. Now we are trying to use it for intune device actions but either we are getting error messages even though we followed everything at Microsoft Graph API docs or nothing happens even though API response success.
we checked the permissions and all needed permissions are given.
we followed docs and tried multiple versions of API URLs mentioned in docs but none of them worked.
we also tried the beta version of API but it didn't work either.
We found some readings about some of these actions work specifically on some OS type or some specific device permissions but we can't find detail on docs.
So we want to use all actions on Intune devices but details on docs are not helpful.
I am getting the following error on related actions
POST https://graph.microsoft.com/v1.0/users/{usersId}/managedDevices/{managedDeviceId}/shutDown
{
"error": {
"code": "BadRequest",
"message": "{ \"_version\": 3, \"Message\": \"An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 2e274924-5fe1-453f-d869-671abf922cfd - Url: https://fef.amsub0502.manage.microsoft.com/DeviceFE/StatelessDeviceFEService/deviceManagement/managedDevices%28%27e002cd5b-f97f-4212-b0b6-38ae3e77938e%27%29/microsoft.management.services.api.shutDown?api-version=5021-04-16\", \"CustomApiErrorPhrase\": \"\", \"RetryAfter\": null, \"ErrorSourceService\": \"\", \"HttpHeaders\": \"{}\"}",
"innerError": {
"date": "2021-05-31T08:44:54",
"request-id": "c869f3f9-def1-4d7f-93af-16b458bc0b17",
"client-request-id": "2e274924-5fe1-453f-d869-671abf922cfd"
}
}
}
POST https://graph.microsoft.com/v1.0/users/{usersId}/managedDevices/{managedDeviceId}/remoteLock
{
"error": {
"code": "BadRequest",
"message": "{ \"_version\": 3, \"Message\": \"An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 6676f0a0-8895-302e-672b-3cdb66092428 - Url: https://fef.amsub0502.manage.microsoft.com/DeviceFE/StatelessDeviceFEService/deviceManagement/managedDevices%28%27e002cd5b-f97f-4212-b0b6-38ae3e77938e%27%29/microsoft.management.services.api.remoteLock?api-version=2021-04-07\", \"CustomApiErrorPhrase\": \"\", \"RetryAfter\": null, \"ErrorSourceService\": \"\", \"HttpHeaders\": \"{}\"}",
"innerError": {
"date": "2021-05-31T08:56:10",
"request-id": "a360b06a-fb02-4af3-9f8f-06e138b76288",
"client-request-id": "6676f0a0-8895-302e-672b-3cdb66092428"
}
}
}
I am getting a success response following actions but nothing happens to the devices
POST https://graph.microsoft.com/v1.0/users/{usersId}/managedDevices/{managedDeviceId}/rebootNow
POST https://graph.microsoft.com/v1.0//deviceManagement/managedDevices/{managedDeviceId}/wipe

Related

Delete API - TriggerDeleteAPIPipeline.Run failed

I'm currently having problems when trying to delete an API. Basically I followed all steps detailed here: https://cdas.azure.chevron.com/api-and-integration.wiki/API-Products/Delete-API-Utility.html. But when I hit the submit button at the last step It gives me this error here:
TriggerDeleteAPIPipeline.Run failed: { "error": { "code": 502, "source": "msmanaged-na.azure-apim.net", "clientRequestId": "019d9dd4-976f-4bbd-9e4c-aac428af2577", "message": "BadGateway", "innerError": { "error": { "code": "NoResponse", "message": "The server did not receive a response from an upstream server. Request tracking id '08585506028467688679246934075CU94'." } } } }
Any help on how to report this issue? thanks in advance.
I finally got the issue solved. The problem was that I needed to ask for the Personal access token in "full access scope".

Microsoft Graph API Invalid URI: The hostname could not be parsed. when using /search/query

I'm trying to search calendars by name with the v1.0/search/query endpoint from the Graph API. However even I'm trying the examples from the Explorer I get the following error:
{
"error": {
"code": "InternalServerError",
"message": "Invalid URI: The hostname could not be parsed.",
"innerError": {
"date": "2022-03-28T19:50:56",
"request-id": "ddb02afc-1c82-4884-d352-4a8d80809b20",
"client-request-id": "58147981-de34-ba11-ab1f-6e17dca603f9"
}
}
}
Graph Explorer:
Is this endpoint still supported? Is it not allowed for Applications?
From the output we can see that , in the tip its saying for adding the permissions for accessing Calendar events and its API's.
so please try to add those permissions and retry again. Please refer this DOC

Microsoft Intune API Bad Request

I was calling the Patch API endpoint for Microsoft Graph API's for Intune in order to update the details of devices present in the portal.
PATCH /deviceManagement/managedDevices/{managedDeviceId}
But in response it is returning Bad Request.
{
"error": {
"code": "BadRequest",
"message": "{ \"_version\": 3, \"Message\": \"An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 2e274924-5fe1-453f-d869-671abf922cfd - Url: https://fef.amsub0502.manage.microsoft.com/DeviceFE/StatelessDeviceFEService/deviceManagement/managedDevices%28%27e002cd5b-f97f-4212-b0b6-38ae3e77938e%27%29/microsoft.management.services.api.shutDown?api-version=5021-04-16\", \"CustomApiErrorPhrase\": \"\", \"RetryAfter\": null, \"ErrorSourceService\": \"\", \"HttpHeaders\": \"{}\"}",
"innerError": {
"date": "2021-05-31T08:44:54",
"request-id": "c869f3f9-def1-4d7f-93af-16b458bc0b17",
"client-request-id": "2e274924-5fe1-453f-d869-671abf922cfd"
}
}
}
I was following every step mentioned in the documentation. We checked the required permissions and all required permissions were provided. We also tried the beta version of API but that also didn't work. So please help me out here if someone knows a fix for this.

Call statistics errors from MS Graph API

We are attempting to install (CLOBBA by CODE Software) which carries out advanced reporting for MS Teams calling. In order for this to work, the software needs to retrieve data from the Microsoft Graph API. Unfortunately this is not working as we get the below error:
This is an example of one of the calls being made - https://graph.microsoft.com/beta/communications/callRecords/45578cfe-8329-48b7-ba6b-54a627b00bf4?$expand=sessions($expand=segments)
The graph API response -
{ "error": { "code": "BadRequest", "message": "Unsupported segment type. ODataQuery: /communications/callRecords/0ff73e29-ddf6-4e6f-9963-6e7fcdf43042", "innerError": { "date": "2020-11-05T11:43:19", "request-id": "b1160328-3ce4-46c9-ae7e-da081001d367", "client-request-id": "b1160328-3ce4-46c9-ae7e-da081001d367" } } }

Fleet Api diferent from Route API - Invalid POI

Something isn't correct with HERE API:
This is working if I use https://route.api.here.com
https://route.api.here.com/routing/7.2/calculateroute.json?app_code=**APP_CODE**&app_id=**APP_ID**&waypoint0=geo!40.881402,-8.633051&waypoint1=geo!38.6143899,-1.1041018&mode=fastest;truck;traffic:enabled&language=pt-pt&routeAttributes=shape
This isn't working if I use http://fleet.api.here.com
http://fleet.api.here.com/2/calculateroute.json?app_code=**APP_CODE**&app_id=**APP_ID**&waypoint0=40.881402,-8.633051&waypoint1=38.6143899,-1.1041018&mode=fastest;truck;traffic:enabled&language=pt-pt
I received this error:
{
"issues": [
{
"message": "Cannot match 38.6143899/-1.1041018 onto a road link with 100.0m search radius"
},
{
"message": "Request id: 5c3aee72-e8f5-4c34-b96c-7c3e3cce5c02"
}
],
"response": null,
"error_id": "5c3aee72-e8f5-4c34-b96c-7c3e3cce5c02",
"response_code": "400 Bad Request"
}
But using the link https://tcs.ext.here.com/examples/v3/cost_optimized_route, I saw this:
Meanwhile, I research the API and if i increase the mapMatchRadius option to 500 m is working. It's very strange. The road exists in Here Maps. Someone from the Here Support Team can provide an input?