Many things can go wrong when you use the Send an HTTP request to SharePoint action. In this post the Common error messages that I have found.
This post is part of my User guide to using the SharePoint REST API in Microsoft Flow for no-code developers series.
When you first start to use the Send an HTTP request to SharePoint action in Microsoft Flow you might run into failures. These failures aren’t always easy to understand. To help resolve common issues I’m collecting failures in this post. If you find any errors yourself then please leave as comment below and I will add it to the list of common error messages.
Conflict – The file XYZ.docx has been modified by i:0#.f|membership|microsoft.flow@domain.com
Within the run history you are likely to see the following message:
{ "message": "The file XYZ.xlsx has been modified by i:0#.f|membership|microsoft.flow@domain.com on 29 Aug 2018 00:54:36 -0700.\r\nclientRequestId: cd61f2ca-dce1-4416-8e7f-02aa43406b66\r\nserviceRequestId: a26d899e-20d6-6000-3dc9-ccb5d34431bd", "status": 409, "source": "https:/ /tenant.sharepoint.com/sites/mysitename/_api/web/lists/GetByTitle('Docs')/items(1729)", "errors": [ "-2130575305", "Microsoft.SharePoint.SPException" ] }
Explanation
Quite often you can ignore these errors. The file mentioned is likely to be updated by your flow at the same time by multiple instances of the flow. The failing flow is trying to update the file while a second instance of the flow is trying to update the file too. As long as you have flows that are triggered by the modification of the document you should be ok. If you have multiple flow instances trying to update the document at the same time you will find that the other instance is successful.
423 – the file XYZ.docx is locked for shared use by
Within the run history you are likely to see the following message:
{ "status": 423, "message": "The file \"https:/ /tenant.sharepoint.com/sites/mysitename/Docs/XYZ.xlsx\" is locked for shared use by firstname.surname@domain.com.\r\nclientRequestId: fc60a27e-58ac-42ae-826e-f57c07e2814a\r\nserviceRequestId: c7ed869e-7033-6000-a8d4-a810c33de57d", "source": "https:/ /tenant.sharepoint.com/sites/mysitename/_api/web/lists/GetByTitle('Docs')/items(7006), "errors": [ "-2147018894", "Microsoft.SharePoint.SPException" ] }
Explanation
When you get the 423 errors, there will be a user that is still updating a document while your flow is trying to update the document too. As long as the user is still saving the document after this failure you should be ok.
NotFound – Item does not exist. It may have been deleted by another user
Within the run history you are likely to see the following message:
{ "message": "Item does not exist. It may have been deleted by another user.\r\nclientRequestId: 34fee8b7-f1ba-4ae1-b8c5-d8079dee170d\r\nserviceRequestId: 9b07839e-6074-6000-3dc9-c9e30f8711e6", "status": 404, "source": "https:/ /domain.sharepoint.com/sites/mysitename/_api/web/lists/GetByTitle('Docs')/items(12649)", "errors": [ "-2130575338", "System.ArgumentException" ] }
Explanation
There can be multiple reasons for this error. The most obvious reason is that the document that Flow is trying to update has been deleted. Alternatively Flow might not have the right permissions to the document.
NotFound – Cannot find resource for the request
Within the run history you are likely to see the following message:
{ “status”: 404, “message”: “Cannot find resource for the request SP.UserProfiles.PeopleManager1.\r\nclientRequestId: 826a48a2-411a-4429-805c-fc0aebbcb118\r\nserviceRequestId: 68d2899e-203d-7000-4795-992bcde30305″, “source”: “https:/ /pieterveenstradev.sharepoint.com/_api/SP.UserProfiles.PeopleManager1″, “errors”: [ “-1”, “Microsoft.SharePoint.Client.ResourceNotFoundException” ] }
Explanation
Well, you made a typo!
The Uri in the Send an HTTP request to SharePoint action is not correct.
BadRequest – An unexpected ‘EndOfInput’ node was found when reading from the JSON reader. A ‘StartObject’ node was expected
Within the run history you are likely to see the following message:
{ “message”: “An unexpected ‘EndOfInput’ node was found when reading from the JSON reader. A ‘StartObject’ node was expected.\r\nclientRequestId: f53b5263-4714-49ae-9e19-6f93d8acb570\r\nserviceRequestId: 92d2899e-20ba-7000-498f-8f42cb18b097″, “status”: 400, “source”: “https:/ /pieterveenstradev.sharepoint.com/_api/web/lists”, “errors”: [ “-1”, “Microsoft.SharePoint.Client.InvalidClientQueryException” ] }
Explanation
This happens when you call /_api/web/lists using a POST Method instead of the get method. This method does exist however the REST API would expect you to supply the information for a list that needs to be created. If you’re just planning to get the lists in a site then you should use POST instead.
BadRequest – Passing in an empty or null value of parameter
Within the run history you are likely to see the following message:
{ "status": 400, "message": "Passing in an empty or null value of parameter 'strTitle'\r\nclientRequestId: 69215962-d608-4b32-a796-272d45324b0f\r\nserviceRequestId: 08d3899e-a0f8-7000-4795-9534adca2029", "source": "https:/ /pieterveenstradev.sharepoint.com/_api/web/lists", "errors": [ "-2147024809", "System.ArgumentException" ] }
Explanation
You get this error when you try to send data in the body to SharePoint, however the format of the body is incorrect.
BadRequest – The property ‘strTitle’ does not exist on type ‘SP.List’. Make sure to only use property names that are defined by the type.
Within the run history you are likely to see the following message:
{ "status": 400, "message": "The property 'strTitle' does not exist on type 'SP.List'. Make sure to only use property names that are defined by the type.\r\nclientRequestId: bddcf9dd-56b2-405c-8fd9-8a0d81ab1fbc\r\nserviceRequestId: 30d3899e-a0ef-7000-4795-97d42b59dc1a", "source": "https:/ /pieterveenstradev.sharepoint.com/_api/web/lists", "errors": [ "-1", "Microsoft.SharePoint.Client.InvalidClientQueryException" ] }
Explanation
When I get these kind of messages I would visit the Url mentioned (https:/ /pieterveenstradev.sharepoint.com/_api/web/lists) in my browser. Then quite quickly you can see which data is expected in the body of your HTTP request. most often this error will occur by having used incorrect fieldnames.
BadRequest – Invalid JSON. The property name ” is not valid. The name of a property cannot be empty
Within the run history you are likely to see the following message:
{ "status": 400, "message": "Invalid JSON. The property name '' is not valid. The name of a property cannot be empty.\r\nclientRequestId: 12e6fc99-a099-41c3-b6ed-2e91bb057d77\r\nserviceRequestId: 64d3899e-505f-7000-4795-9f6595243474", "source": "https:/ /pieterveenstradev.sharepoint.com/_api/web/lists", "errors": [ "-1", "Microsoft.SharePoint.Client.InvalidClientQueryException" ] }
Explanation
This is one of my favourites! If you get to experience this problem it is likely that you have been using copy/paste to create your HTTP request body. This has happened to me in the past where I copied configurations from blog posts and each quote (‘)was replaced by a backquote/backtick (`)
Hi Pieter, came across your blog from searching on 400 error in Flow. I’m trying to call Flow on an Access Request list, and getting this 400 error: “Permission Level Requested” is not supported.
If you have any idea on how to bypass/correct that, it would be huge in getting notification on site Access Request invite update! Thanks in advance if anything comes to mind!
Hi Theresa, Can you send me an email with a screenshot of the flow in edit mode and run mode of the failing step? Please email me on contact@veenstra.me.uk
Hi Pieter, I try to move Documents from one Sitecollection to another and get this error code: error 400 “Source file not set\r\nclientRequestId: e042f8f1-8d87-45eb-a854-05896f490943\r\nserviceRequestId: e042f8f1-8d87-45eb-a854-05896f490943”
Can you help me with it?
can you send me the output from an active run?
I wanted to test this functionality in Power Automate and it gives me an error that “Value can not be null”.
To give some details:
Site Address: My site address
Method: POST
Uri: _api/Web/GetFolderByServerRelativeUrl(‘Documents’)/Folders
Headers:
Content-Type application/json;odata=verbose;(tried without too)
Accept application/json;odata=verbose;
Body:
{‘__metadata’:{‘type’:’SP.Folder’},’SPWeb.ServerRelativeUrl’:’/Documents/MyFolder’}
Please note that I tried with ServerRelativeUrl alone, then Power Automate suggested to use SPWeb in the front!
I also created a document library and gave that information here for Documents but same result. What I am doing wrong? This can not be complicated!!
thank you
Hi Ajay,
Which site are you createing this in is it in the root site collection https://xyz.sharepoint.com or https://xyz.sharepoint.com/sites/anysite
Also can you check what the url name for your document library is?
In your browser can you go to
https://xyz.sharepoint.com/_api/Web/GetFolderByServerRelativeUrl('Documents‘) or https://xyz.sharepoint.com/sites/anysite/_api/Web/GetFolderByServerRelativeUrl('/sites/anysite/Documents‘)
You might have to change the Document part of the Server Relative Url as it may not be Documents.
Thank you for your prompt response but both suggestions on pasting the url don’t work! I have the site as https://xyz.sharepoint.com/sites/anysite
I have got Documents folder and also have got other folders which I created using SharePoint! But none of them work with respect to the url what you mentioned!
Would really appreciate if you got it!
When I test it, it says value can not be null and can’t follow what value it is talking about, Giving details below:
Site Address: https://xyz.sharepoint.com/sites/anysite
Method: POST
Uri: _api/Web/GetFolderByServerRelativeUrl(‘Documents’)/Folders
Headers:
Content-Type application/json;odata=verbose;(tried without too)
Accept application/json;odata=verbose;
Body:
{‘__metadata’:{‘type’:’SP.Folder’},’SPWeb.ServerRelativeUrl’:’/Documents/MyFolder’}
Hope you understand. Thank you so much.
_api/web/GetFolderByServerRelativeUrl(‘/sites/anysite/Documents’)
Should work
Since this wasn’t working I eventually used Create new folder feature in flow! But here the irony is that I can’t see name of my folder, Libraries, which carries all documents! I don’t what I am missing here. In Nintex I see Review Document Library template and that is what they used in creating Wf in SP 2010 and same is available in Power Automate. Using that creates a folder called Review Document Library template!
It is learning but again sometimes feel Microsoft is using developers all over the world to test!
Hi Peter, Got the following error from one of my flows:
“Cannot convert a primitive value to the expected type ‘Edm.Double’. See the inner exception for more details.\r\nclientRequestId: f45534b2-4c6a-40cc-9f1c-26cb6159a30f\r\nserviceRequestId: f7d3809f-31f7-0017-5248-41cafcd857e2;f7d3809f-11fd-0017-5248-4c71016c4a29;f8d3809f-c109-0017-5248-48e221ba0811;f8d3809f-7117-0017-5248-49cbd7b0b89f;f8d3809f-4120-0017-5248-464a70f57c2c”,
Any idea why? Thanks
Hi Mike,
Can you supply the json used to update/create an item? The problem is that the json is using the wrong format data. A bit like supplying text for a number field. First thing to do is identify which field it is. Then check the data supplied for this field. Quite often once you know which field it is it isn’t too hard to fix the data.
Hi Pieter,
I had the same issue as the last one (Invalid JSON. The property name ” is not valid).
In my case, I had hidden “space” characters: they would appear as space but weren’t.
I had to copy-paste the body (json) in Notepad++ to visualize the bad spaces and replace them with ‘real’ space characters.
What a waste of time before I found out !
Thanks for your posts, always instructive.
{
“status”: 400,
“message”: “Not well formatted JSON stream.\r\nclientRequestId: bff1ce8e-b776-4078-9e52-e8d9a3a89265\r\nserviceRequestId: 698c2da0-5016-3000-e324-8168bc4fa911”,
“source”: “https://ascogroupuae.sharepoint.com/sites/YASIntraWorld/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.CreateSiteDesign”,
“errors”: [
“-1”,
“Microsoft.SharePoint.Client.InvalidClientQueryException”
]
}
Can you suoply me with the request body please?
File not found
clientRequestId: a56a40a8-8f4b-4ebe-adbf-619b9cfef0b3
serviceRequestId: a56a40a8-8f4b-4ebe-adbf-619b9cfef0b3