SharePoint list - provided #odata.nextLink results in Error 500 - microsoft-graph-api

It seems there's an issue happening (at least within my tenant) when paging results from SharePoint Online lists; the URL provided in #odata.nextLink doesn't work, resulting in Error 500 (generalException).
I'm using a following query:
/beta/sites/[site URL],[site ID]/lists/[list ID]/items?expand=fields
The first page of results comes in correctly, and the #odata.nextLink property contains a following URL:
https://graph.microsoft.com/beta/sites/[site URL],[site ID]/lists/[list ID]/items?expand=fields&$skiptoken=Paged%3dTRUE%26p_ID%3d205
Unfortunately, using it results in:
{
"error": {
"code": "generalException",
"message": "An unspecified error has occurred.",
"innerError": {
"request-id": "f7e33c22-15b5-4aac-b928-31c1a2bf04ae",
"date": "2018-01-11T09:48:57"
}
}
}
This happens using both the /beta and /v1.0 endpoint.
Tested on multiple lists and sites within my tenant.
Tested without ?expand=fields
It was working perfectly before last Thursday (Jan. 11th).
The customer service for O365 is unable to help, pointing me to MSDN forums.

Thanks for bringing this to our attention Jakub. You found a regression that slipped through our testing - thankfully there was a quick solution so you should no longer reproduce the issue.

Related

issue with Microsoft graph api with forward slashes "/" in /me/events/{id}

I am having a similar issue to the post described here.
How to get an event ID from the HitID returned by a Microsoft Graph search query?
In my case I am not trying to do a patch, but just a lookup via the v1.0/me/events/{id} get request. I am using the search API of Microsoft graph API. It returns me a HitId with forward slashes in it. I tried to resolve it in the exact same way as the post describes, but cant seem to get it to work. My id parameter is:
AAMkADgwZjlhNmJjLWNiMGQtNGE5MS1hMDVkLTNkNTU2ZWE5ZmM5ZgBGAAAAAAAjq0f6CrWJSoJ6oKcYbrJfBwAyr2CWzX9CSrX7fgfr1AFOAAAAAAENAAAyr2CWzX9CSrX7fgfr1AFOAAV/rENQAAA=
I replaced the / with %252F and the call still fails. The new request id is:
AAMkADgwZjlhNmJjLWNiMGQtNGE5MS1hMDVkLTNkNTU2ZWE5ZmM5ZgBGAAAAAAAjq0f6CrWJSoJ6oKcYbrJfBwAyr2CWzX9CSrX7fgfr1AFOAAAAAAENAAAyr2CWzX9CSrX7fgfr1AFOAAV%252FrENQAAA=
which still fails in exactly the same way. To isolate the problem I used Microsoft Graph API explorer to test the request, which returns the following error message
{
"error": {
"code": "RequestBroker--ParseUri",
"message": "Resource not found for the segment 'rENQAAA='.",
"innerError": {
"date": "2021-03-18T07:48:24",
"request-id": "83cecc8b-f510-4cf0-b5f1-e4cd5f09e223",
"client-request-id": "530677e9-fa2d-a842-149e-a8db4939f3b8"
}
}
}
I cant seem to find any suitable documentation on how to resolve the issue.
Thanks in advance for any help.
Where ever you get / simply replace it with -. This will resolve your issue.

preferredDataLocation field in microsoft graph API not working in v1.0

I am working on a feature where I need to find preferredDataLocation field for all the users but it turns out that it is currently in beta version. How can we check estimated date of this feature going into stable version? I tried to check on Microsoft 365 Roadmap but couldn't find it. I tried to use following request
https://graph.microsoft.com/v1.0/users/delta$select=id,preferredDataLocation
but it gives the following error
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Invalid property: preferredDataLocation",
"innerError": {
"request-id": "c93a43cb-fa9d-4803-801a-5864439ad66d",
"date": "2020-06-02T09:24:30"
}
}
}
If I use request without delta then it works fine. Example
https://graph.microsoft.com/v1.0/users$select=id,preferredDataLocation
After checking in the metadata the property is not available in v1.0 for users today (only groups). Hence why it fails when requested for delta query. I created a documentation issue to get the documentation fixed.
You can perform the same query using the beta endpoint today as a workaround.

Microsoft.SharePoint.Client.UnknownError from Graph API

Trying to get the details of a SharePoint site using a relative url.
GET /v1.0/sites/mytenant.sharepoint.com:/sites/mvep
However if the relative path is pointing to a site that does not exist I get a 500 Internal Server Error returned with the following json:
"error": {
"code": "-1, Microsoft.SharePoint.Client.UnknownError",
"message": "Unknown Error",
"innerError": {
"request-id": "bc65a8a8-e857-4ece-9e1d-f42b5671f151",
"date": "2018-12-05T11:44:13"
}}
I tried same test against a demo tenant and the correct 404 / itemNotFound is returned.
There was a few posts here talking of a regression introduced back in Dec 2017 that was apparently fixed.
Could this patch have been missed on our SPO servers?
Or is it a new regression?
Thanks in advance.
Tested again this morning and it now works as expected.

UnknownError accessing pages from OneNote

I am connecting to Notebooks stored on SharePoint and getting "UnknownError" using the Graph API when trying to retrieve Pages.
I have no problem querying notebooks, sections or sectiongroups - that's all working, so no authentication problems or anything
Request:
https://graph.microsoft.com/v1.0/sites/{app id}/onenote/pages
Error below:
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "65721acc-f0d9-40d6-bf80-aac1507a6c2f",
"date": "2018-01-02T17:34:21"
}
}
}
Graph explorer returns this after about 30 seconds, so I'm guessing it's timing out. There are about 10 notebooks in the site I'm connecting to, which each have several hundred pages
I do only need to return 1 page at a time in almost every case. I have tried adding a $filter= at the end, but get the same problem
I would strongly recommend to get pages for each section rather than getting all the pages that the user has access to.
Please refer to the bottom 2 recommendations in this article: https://blogs.msdn.microsoft.com/onenotedev/2017/07/21/a-few-performance-tips-for-using-the-onenote-api/

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