I’m at wits end here. Everything I've tried has failed.
There are lots of examples available demonstrating how to use the "_api/SP.WorkflowServices" to launch a WF. I can’t get this to work. I’m able to successfully use other api’s to get information and build the request header for the "_api/SP.WorkflowServices" POST.
Method:
- Create a new item and capture the NewItemGUID
- ItemID: attained by "_api/web/lists/getByTitle('[ListName]')/items?$filter=GUID eq '[NewItemGUID]'"
- ListGUID: attained by "_api/web/lists/getByTitle('[ListName]')?"
- WorkflowGUID: attained by "_api/SP.WorkflowServices.WorkflowSubscriptionService.Current/EnumerateSubscriptionsByList(guid'[ListGUID]')?select=Id,Name"
Request header:
- Accept : application/json;odata=verbose
- Content-Type : application/json;odata=verbose
- Content-Length: 255
- X-RequestDigest: attained by "_api/contextinfo" and reading dictionary for "d/GetContextWebInformation/FormDigestValue"
Workflow call http web service
- [website]_api/SP.WorkflowServices.WorkflowInstanceService.Current/StartWorkflowOnListItemBySubscriptionId(subscriptionId='WorkflowGUID',itemId=’ItemID’)
The above 'Workflow call' loops a few times with a delay just in case the server workflow service is busy.
Sharepiont responds with ‘BadRequest’. Same attempt in Fiddler gives me ‘Forbidden’. How can I troubleshoot this farther?
How can I parse the Response Content to review the http error in detail?
Can this work at all? Are there other examples I can try?
Some references I have used.
Workflow – Useful REST calls – Start a workflow
SharePoint 2013 Workflow recursion prevention – Part 2
CleverWorkarounds
Kind regards,
There are lots of examples available demonstrating how to use the "_api/SP.WorkflowServices" to launch a WF. I can’t get this to work. I’m able to successfully use other api’s to get information and build the request header for the "_api/SP.WorkflowServices" POST.
Method:
- Create a new item and capture the NewItemGUID
- ItemID: attained by "_api/web/lists/getByTitle('[ListName]')/items?$filter=GUID eq '[NewItemGUID]'"
- ListGUID: attained by "_api/web/lists/getByTitle('[ListName]')?"
- WorkflowGUID: attained by "_api/SP.WorkflowServices.WorkflowSubscriptionService.Current/EnumerateSubscriptionsByList(guid'[ListGUID]')?select=Id,Name"
Request header:
- Accept : application/json;odata=verbose
- Content-Type : application/json;odata=verbose
- Content-Length: 255
- X-RequestDigest: attained by "_api/contextinfo" and reading dictionary for "d/GetContextWebInformation/FormDigestValue"
Workflow call http web service
- [website]_api/SP.WorkflowServices.WorkflowInstanceService.Current/StartWorkflowOnListItemBySubscriptionId(subscriptionId='WorkflowGUID',itemId=’ItemID’)
The above 'Workflow call' loops a few times with a delay just in case the server workflow service is busy.
Sharepiont responds with ‘BadRequest’. Same attempt in Fiddler gives me ‘Forbidden’. How can I troubleshoot this farther?
How can I parse the Response Content to review the http error in detail?
Can this work at all? Are there other examples I can try?
Some references I have used.
Workflow – Useful REST calls – Start a workflow
SharePoint 2013 Workflow recursion prevention – Part 2
CleverWorkarounds
Kind regards,