Internal server error on POST to /subscriptions - microsoft-graph-api

I'm trying to create a subscription to changes on the Inbox email folder.
The POST content is:
{
"changeType": "created,updated,deleted",
"notificationUrl":"https://private_webhook_url",
"resource":"/me/mailFolders('inbox')/messages",
"expirationDateTime":"2018-12-22T12:08:59Z",
"clientState":"a_client_state"
}
The result I get is a 500 Server Error with the following response body:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: InternalServerError; Reason: Internal Server Error]",
"innerError": {
"request-id": "5f581bcb-db5c-4842-b408-ee58d614cf98",
"date": "2018-12-19T13:39:01"
}
}
}
I wonder if I'm doing something wrong or if this is a problem with the Graph API. Is anyone able to help me?
Thanks in advance.

Does your clientState have CRLF characters because that is the error we see on the server side? Can you please try with a different value of clientState and confirm if it is working?

Related

500 error "nextLink value without skip or skiptoken" delta 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

Getting error "invalidRequest" when creating upload session (Microsoft Graph Api)

I am getting the below error when creating upload session (Microsoft Graph Api).
{
"error": {
"code": "invalidRequest",
"message": "Invalid request",
"innerError": {
"request-id": "6e9cc58e-d3b9-456e-a794-90486969296e",
"date": "2020-04-06T20:53:18"
}
}
}
Post request https://graph.microsoft.com/v1.0/me/drive/root:/testapi:/createUploadSession
Request body :
I have modified the request as below to make it work. See below :
POST https://graph.microsoft.com/v1.0/me/drive/items/01WCLVX5B7JBMYFMQKWNA3NVFODWCDUPGB:/3.pdf:/createUploadSession
I was implementing C# from here where the code was
var uploadSession = await graphClient.Me.Drive.Root
.ItemWithPath(itemPath)
.CreateUploadSession(uploadProps)
.Request()
.PostAsync();
In my case, I was able to fix it by updating itemPath by adding the full path to the file. For instance, if the path is
/RootFolder/Folder1
just update with file name like this
/RootFolder/Folder1/MyFile.pdf

SharePoint returns General Exception: An unspecified error has occurred

We create a Team with Power Automate using the Graph API from an HTTP Action:
We are calling the following URI using application permissions.
https://graph.microsoft.com/v1.0/groups('8c250cdd-1f21-405d-b45f-f95cf248e9d8')/sites('root')/webUrl
But the result is an HTTP 500:
{
"error": {
"code": "generalException",
"message": "An unspecified error has occurred.",
"innerError": {
"request-id": "0649718d-057d-4c4c-9fec-986c158376ee",
"date": "2019-12-02T09:11:10"
}
}
}
Calling the same URL in Graph Explorer works as expected.
The solution is to use a custom connector instead of an HTTP action.

Receiving a Bad Request error when creating webhook

When I try to send in a POST to create a new webhook I receive a bad request error:
{
"error": {
"docs": "https://developer.surveymonkey.com/api/v3/#error-codes",
"message": "URL https://ws.nxturn.com/NXT_survey_response did not return a success status code.",
"id": "1000",
"name": "Bad Request",
"http_status_code": 400
}
}
However, when I try to send a HEAD to my server I receive a 200 response back as expected. I am not sure how I can troubleshoot this?
Has anyone else resolved this issue?
That URL does not support HTTPS

Authentication error when reading Microsoft Graph /synchronizationProfile

I need to read the list of synchtonizationProfile entities. I get accessToken using grant_type=code and requested permissions for EduAdministration.Read and EduAdministration.ReadWrite (as specified in the documentation).
But when I try the request, I get the following error:
{
"error": {
"code": "AuthenticationError",
"message": "Error authenticating with resource.",
"innerError": {
"request-id": "1a47270e-f902-48af-81cc-5ed8e279b050",
"date": "2017-12-21T12:20:27"
}
}
}
The problem only with the /synchronizationProfiles endpoint.
What is the problem? And how to solve it?

Resources