500 error "nextLink value without skip or skiptoken" delta API - microsoft-graph-api

I'm trying to track changes on a sharepoint drive but I got an obscure error message.
Here my call:
https://graph.microsoft.com/v1.0/drives/{direvId}/root/delta
And here the response:
{
"error": {
"code": "InternalServerError",
"message": "nextLink value without skip or skiptoken",
"innerError": {
"date": "2021-02-03T16:38:03",
"request-id": "4cb9de13-817d-47c7-a0b3-2605470789b9",
"client-request-id": "4cb9de13-817d-47c7-a0b3-2605470789b9"
}
}
}
Any clue?
EDIT:
The issue is releated to the application access token.

Ok I found the issue. Using postman and having the header Prefer set as follow Prefer: apiversion=2.1 was causing the 500 error.
With no Prefer header set or using the headers suggested in the documentation everything is working as expected.enter link description here

Related

Microsoft Graph API CallRecord with expanded sessions returns an error

When I execute a request for a specific callRecord like this it works:
https://graph.microsoft.com/v1.0/communications/callRecords/{id}
But when I do this I get an error (500):
https://graph.microsoft.com/v1.0/communications/callRecords/{id}?$expand=sessions
{
"error": {
"code": "InternalServerError",
"message": "Object reference not set to an instance of an object.",
"innerError": {
"date": "2022-04-14T12:21:34",
"request-id": "{guid}",
"client-request-id": "{guid}"
}
}
}
It looks like this doesn't happen for every callRecord though. We started seeing this error in our logging around 2022-04-11T00:24:00Z, now we get thousands of those.
It was an internal issue on Microsoft's side. Everything seems to be fixed.

$search and $expand operator does not work in graph api users

I am using graph api to get users and groups information,
but looks it does not work, can anyone help me?
my query uri:
https://graph.microsoft.com/v1.0/users?$search="displayname:user"&$count=true&$top=250&$expand=transitiveMemberOf($select=displayname)
and the error message:
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Request with $search query parameter only works through MSGraph with a special request header: 'ConsistencyLevel: eventual'",
"innerError": {
"date": "2022-01-14T11:06:50",
"request-id": "e57ce8c4-f1bc-4b32-8559-1fac5c133b9d",
"client-request-id": "c85557de-6e80-10b6-7c68-d84334181dd0"
}
}
}
and i added the request header[ConsistencyLevel: eventual] nothing changed.
Adding request header ConsistencyLevel:eventual and removing &$expand=transitiveMemberOf($select=displayname)
related documents:
troubleshooting your error message
expand parameter
According the documentation and github issue, unfortunately $search (requiring the advanced query parameters) doesn't support $expand.

Calls to /events/ returning error: "This operation does not support binding to a non-calendar folder."

When making this GET request:
https://graph.microsoft.com/v1.0/me/events/{EVENT_ID}?%24select=id%2Csubject%2Ccategories%2CseriesMasterId",
The Graph API is returning HTTP 400 with the details below. I am unable to find documentation explaining this error. Any help would be greatly appreciated.
{
"code": "ErrorInvalidRequest",
"message": "Your request can't be completed. This operation does not support binding to a non-calendar folder.",
"innerError": {
"request-id": "8b92c8b2-3b52-4640-998f-cc07e56bdc27",
"date": "2019-04-26T21:17:18"
}
}
Update: This behavior seems to happen when querying for the status of an event that has been deleted by a user. Would be great for Microsoft to document this behavior -- assuming this is in fact intended.

400 when accessing shared file using graph api with shared url

I called the endpoint /shares/{shareId} using msgraph-sdk-php, but got response 400 as:
{
"#odata.context":"https://graph.microsoft.com/v1.0/$metadata#shares/$entity",
"id":"s!here-is-the-share-id",
"name#odata.type":"#String",
"name":{
"error": {
"code": "BadRequest",
"message": "A primitive value was specified; however, a value of the non-primitive type '' was expected.",
"innerError": {
"request-id": "3ea56b1c-acd6-4fdf-a856-c46b35e01cb7",
"date": "2017-05-25T05:26:23"
}
}
}
(Yes, I even got 4 left brackets but only 3 right brackets.)
while I can get correct response via api.onedrive.com api with the same shareId.
I really can't find any tips from documentation.
Thanks for letting us know about this #SevenOutman! This was a configuration issue that has now been resolved.

GraphApi API error codes

I am attempting to create a interface between our web application and the GraphApi.
I am currently struggling to handle error correctly as the documentation for graph API seems to be at best incomplete. Is there a reference to full list of errors one should expect.
An example of the issue is where I make a request after my access token has expired. The error code is not on the list (graph.microsoft.io docs/overview/errors page) and in a different format (capitalization). It also seems to vary drastically from the azure error codes such as "Request_BadRequest". This was found in an MSDN article titled "Error codes and error handling | Graph API concepts".
The document states "You may use the information returned here instead of, or in addition to the HTTP status code returned.". However, this is really hard if they are changing despite being out of beta.
example of an error response body:
{ "error": {
"code": "InvalidAuthenticationToken",
"message": "Access token has expired.",
"innerError": {
"request-id": "267438d2-4cc5-4621-9307-2af26d2f5b49",
"date": "2016-02-16T13:30:24"
}
}
}

Resources