Graph API responding with Unexpected response from the service in Power Automate

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.

Unexpected response from the service

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:

  • Permissions
  • Incorrect Header
  • Incorrect URL supplied for the Graph API end point
  • Something is wrong with the SharePoint site, list, content types

So in short something is wrong, but how do we solve this issue

Error responses and fixing the issues

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.

Graph API responding with Unexpected response from the service in Power Automate Microsoft Office 365 image 4

We can also see the fields required in the body of the request. In this case we need to supply a contentTypeId.

Graph API responding with Unexpected response from the service in Power Automate Microsoft Office 365 image 5

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.

Content Type Gallery

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.

Graph API responding with Unexpected response from the service in Power Automate Microsoft Office 365 image 6

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.

Further Help with the Graph API

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

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
February 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28   
« Jan   Mar »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...