2013 Workflow Post Example

I need a good example of how to MERGE data using REST in SharePoint 2013 Workflows. I can't seem to make it work from the examples I have seen.

http://blog.ctp.com/2014/03/12/updating-list-items-using-sharepoint-2013-workflow-engine/

I get a bad response when I attempt to change the tile of an item.

My goal is to create an approval workflow with REST calls.  I want to create a reusable workflow and not directly make workflows on each list.

May 18th, 2015 2:42pm

Anyone? 

I can't seem to figure out what I'm doing wrong.  Anyone?

I keep reading about Approvals not being possible with REST.  Seriously?

I keep getting blocked.  I don't want to create an approval process for every flipping library.  I should be able to make a reusable workflow do approvals!@@@

Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 6:17pm

I finally have a working example but I'm confused as to why what I want is failing.

If I try to create an item in a list it works.

URL:
http://sharepointtest/_api/web/lists/getbytitle('Locations')/items

Header:
Accept: application/json;odata=verbose
Content-Type:  application/json;odata=verbose

Metadata:
type: SP.Data.LocationsListItem

Parameters:
__metadata:  Metadata
Title: New Item name

What I want to do is update a specific item in a document library. 

Can anyone help fill in the blanks?

May 19th, 2015 10:40am

I tried this but I get "InternalServerError".

URL:
http://sharepointtest/_api/web/lists/getbytitle('Information%20Systems')/items

Header:
Accept: application/json;odata=verbose
Content-Type:  application/json;odata=verbose

Metadata:
type: SP.Data.Information_x0020_SystemsItem

Parameters:
__metadata:  Metadata
Title: New Item name

Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 10:50am

I was hoping above would create an item.

Trying to update an item has the same effect.  I tried this:

URL:
http://sharepointtest/_api/web/lists/getbytitle('Information%20Systems')/items('90')

Header:
Accept: application/json;odata=verbose
Content-Type:  application/json;odata=verbose
X-HTTP-Method: MERGE
IF-MATCH: *

Metadata:
type: SP.Data.Information_x0020_SystemsItem

Parameters:
__metadata:  Metadata
Title: New Item name

May 19th, 2015 11:05am

This looks promising.

https://msdn.microsoft.com/EN-US/library/office/dn450841.aspx#bk_FileApprove

It looks like I need to get to the file through a different REST query to approve it.

Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 1:54pm

Tried this and got UnAuthorized.

URL:
http://sharepointtest/_api/web/getfilebyserverrelativeurl('/Information%20Systems/Certificate%20Authority%20Setup.docx')/approve(comment='Check-in%20comment%20for%20the%20approval.')

Header:
Accept: application/json;odata=verbose
Content-Type:  application/json;odata=verbose
X-HTTP-Method: MERGE
IF-MATCH: *

Metadata:
type: SP.Data.Information_x0020_SystemsItem

Parameters:
__metadata:  Metadata

May 19th, 2015 2:11pm

Finally I got it.

To approve a doc you have to use the Approve function like above.

I was getting access denied because I hadn't authorized the application permissions.

example from site:  http://sharepointryan.com/2013/09/10/create-a-sharepoint-site-spweb-using-rest-in-spd-2013-workflow/

Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 2:40pm

Hi David,

Glad that you solved the issue, and thanks for sharing, this will benifit others who have similar issue in the future.

Thanks

Daniel Yang

May 19th, 2015 10:24pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics