Hi Team,
Currently we are facing an issue with using SharePoint - Send Http request action in order insert, update a SharePoint Document library content type based list items. When we tried to Post a JSON message to SharePoint Rest API for creating a new list item in Document library we are getting following error:
{
"error": {
"code": 502,
"source": "firstrelease-001.azure-apim.net",
"clientRequestId": "22630973-c0d1-4dfd-b644-de9a2148ce68",
"message": "BadGateway",
"innerError": {
"message": "To add an item to a document library, use SPFileCollection.Add()\r\nclientRequestId: 22630973-c0d1-4dfd-b644-de9a2148ce68\r\nserviceRequestId: 1a73779e-6003-0000-9acb-ea7611f705ab",
"status": 502,
"source": "..../_api/web/lists/getbytitle('DemoContent')/items",
"errors": [
"-2146232832",
"Microsoft.SharePoint.SPException"
]
}
}
}
Do we need to have two actions for dealing with inserting a new item in to document library? We are trying to provide all the list item details in a JSON based on document library metadata, but still we are getting an error to use SPFileCollection.Add() method. Is this we need to create a file first and then we need to insert the list item in to Document library when we use SharePoint Rest API? Please provide us some pointers about resolving this issue...
Thanks,
Vdeevi