Today a real SharePains post. I create a flow that makes a call to the Microsoft Graph API and I’m getting “Unexpected response from the service”. This is as good as something went wrong.
The Unexpected response from the service error message doesn’t give us very much. You get these errors when something is wrong within the request. This error seems to catch all the errors that can possibly happen when we try to do something in SharePoint with the Graph API.
Some of the issues I’ve found generating this error are:
So in short something is wrong, but how do we solve this issue
The documentation gives us a list of failure codes. Anything above the 400 status code is a bit helpful. But the 400 error code is simply just a pain. For more details on the error codes please see the following link: https://learn.microsoft.com/en-us/graph/errors
Well you could have a look at the documentation first. We might just have made a typo somewhere.
In my example above I tried to copy a content type from the Content Type Gallery to a list. In the documentation we will see that we will have to supply the Content-Type header. It is such an easy thing to forget.
We can also see the fields required in the body of the request. In this case we need to supply a contentTypeId.
Well, I got that right too. So where do I go next?
The 400 error means two things. There is something wrong within SharePoint or I’ve done something wrong. We just checked that I got the request right, so there is something wrong in SharePoint.
Sounds easy, but the solution may still not be easy to find.
So I’m trying to do something with Content Types. So it is always worth it to try to do manually within the SharePoint UI what I’m trying to do with the Graph API.
In this case I went to the site and found that I had an issue with one of my content types as there was an issue with one of the the site columns. So I’m quite lucky that SharePoint just gave me the answer. Quite often where something is failing you just have to try manually what you tried to automate.
In my case my API call worked for 100s of sites and this one site had a column conflict.
And when I look at the Content type publishing error log I get further details on the issue. And quite quickly I found the column that was causing the problem.
Please have a look at my series of posts about the Graph API within the Power Platform
Continue Reading Pieter Veenstra’s Article on their blog
Graph API responding with Unexpected response from the service in Power Automate
Today in a flow that makes a call to the Microsoft Graph API, I saw “Unexpected response from the service”. This is as good as something went wrong.
Blog Syndicated with Pieter Veenstra’s Permission