Currently trying to use the Web Services within Sharepoint Designer to create a list item in a list on a different site collection using the POST method.
The workflow itself runs til completion but no items are created.
I'm only trying to test it with the Title field alone.
Here's the breakdown of my code:
ProjecSiteURL = http://www.mysite.sharepoint.com/sites/Apps/Project/
ProjectListName = Projects
CallDesiredAction = SP.Data.ProjectsListItem
CallURL =
[%Variable:ProjectSiteURL%]/_api/web/lists/getbytitle('[%Variable:ProjectListName%]')/items
I have three dictionaries:
header:
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose
metadata:
type: Variable: CallDesiredAction
parameters:
__metadata: Variable: metadata
Title: Created by REST
I then log the parameters, which is shown as the following on the workflow history log:
{"__metadata":{"type":"SP.Data.ProjectsListItem"},"Title":"Created by REST"}
Finally the REST call itself uses the POST method and uses the following settings:
The workflow executes but creates nothing, only other thing I can note is that the log I've created for the responseCode after the REST Call returns as "BadRequest"
Any help is greatly appreciated. Starting to bang my head against a wall!
__metadata
property in the body if you useapplication/json;odata=nometadata
orapplication/json;odata=minimalmetadata
. @Rothrock's suggestions are spot on, and should help you isolate the issue.