Skip to main content
Nintex Community Menu Bar

How to execute a SP2013 REST API request with Nintex Workflow


Did this topic help you find an answer to your question?
Show first post

91 replies

Forum|alt.badge.img+3

Thank you , there was a syntax error

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • March 12, 2018

I'm glad that you could solve your issue

Translate

Forum|alt.badge.img+5
  • Novice
  • 27 replies
  • May 14, 2018

This is a fantastic article and should be bookmarked in every SharePoint developer's Nintex Community profile. Thanks for the guidance, Caroline!

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • May 14, 2018

Thanks for the comment Christian ! I'm glad if this article can help

Translate

Forum|alt.badge.img+3
  • 12 replies
  • December 31, 2018

Dear Caroline Jung‌, I need your help.

I 'm using REST API to add permission to a user on an item within a list. I have successfully removed the inheritance with a post request to :

https://URL/ts/_api/web/lists/getByTitle('Timesheet Reports')/items(32)/breakroleinheritance(copyRoleAssignments=true,clearSubscopes=true)‍

However, when I try to add new item level permission to the item with the bellow context:

https://URL/_api/web/lists/getByTitle('Timesheet Reports')/items(32)/roleassignments/addroleassignment(principalid=9;roledefid=1073741826)

‍‍

where principalid=9 is the "ID" for the user (not group) retrieved from :

https://URL/_api/web/siteusers

 

I'll get the bellow error in response :

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>
-1, Microsoft.SharePoint.Client.InvalidClientQueryException
</m:code>
<m:message xml:lang="en-US">
The expression "web/lists/getByTitle('Timesheet Reports')/items(32)/roleassignments/addroleassignment(principalid=9;roledefid=1073741826)" is not valid.
</m:message>
</m:error>‍‍‍‍‍‍‍‍‍

Please advice.

Updates >>

Issue was related to bad syntax. I was using ; instead of ,

Translate

kmccool
Forum|alt.badge.img+9
  • Scholar
  • 102 replies
  • January 3, 2019

I'm using PowerShell to get the list of items that haven't been modified in a while and emailing the last modifier asking them if they want to delete stale items. (We're doing a massive SharePoint cleanup project)

I would like a workflow to delete the item using the web request POST action but am troubleshooting atm.

Is it normal to have the date/time stamp on then end of my Digest Value?

Thanks

Kassie

Translate

Forum|alt.badge.img+3
  • 12 replies
  • January 3, 2019

Dear Kassie,

Digest value always ends with a time stamp, and the timestam is usually half an hour valid.

Your problem should be somewhere else.

Translate

kmccool
Forum|alt.badge.img+9
  • Scholar
  • 102 replies
  • January 4, 2019

Ok, thanks to this post, I've got the auto delete working with the web request for our SharePoint cleanup project.

Now I need to move items to an archive library if the user selects to send the document to records. Is there a method I could use to move a document to the archive list? I would use the copy action but these items are all housed in different library locations on the site collection, they are just listed on this clean up list.  

Any ideas for me?

Thanks

Kassie

Translate

Forum|alt.badge.img+3
  • 12 replies
  • January 6, 2019

Dear Kassie McCool‌, if you mean the list in which it's items should cleaned up, contains document address, then you could simply read the address in workflow (with a variable) and use it in the copy action to copy it to the archive library. then simply delete the document from the original library.

then your workflow should have this actions in order:  ( I couldn't take snapshots so I just type the logic  )

Run If (condition should be "if the user selected the archive option")

Set Variable (read the address in a variable)

Copy Item (Copy the item with the address in variable as source to archive destination library)

Delete Item (use variable as source to delete the Source Item)

}

Translate

kmccool
Forum|alt.badge.img+9
  • Scholar
  • 102 replies
  • January 7, 2019

Thanks for the reply behy.

I'm on 2013 on prem. Not sure if we're on different versions, but my Copy item action does not allow me to customize the source value with a variable value.

Or are you saying to use these methods in my web call?

Thanks

Kassie

Translate

Forum|alt.badge.img+3
  • 12 replies
  • January 8, 2019

You're right Kassie McCool‌, variable is not an option. also you're not able to copy/paste items across sites. you're only able to do that within the same site.

is it in the same site? I mean source and target.

Translate

kmccool
Forum|alt.badge.img+9
  • Scholar
  • 102 replies
  • January 8, 2019

They are on the same site. I was kind of hoping to do this as a web request. I found some info on SharePoint folder moves but I don't want to move a folder, just a document.

Here's what I have so far. I popped off the folder portion of the syntax but it isn't working yet.

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee658974(v=office.14

I'm sure I'll get there. Just have to keep working on it.

thanks

Kassie

Translate

Forum|alt.badge.img+5
  • 45 replies
  • January 8, 2019

I don't know if it will help in your case, but here is what I have used to move a document within the same library:

Translate

kmccool
Forum|alt.badge.img+9
  • Scholar
  • 102 replies
  • January 15, 2019

Thanks for the reply Ken.

This is getting me pretty close. I found almost the same solution from Vadim Tabakman‌'s blog post here and added a header as he suggested.

I am still having trouble getting it to work. I'm getting an error in my result, "Error performing web request. The underlying connection was closed: The connection was closed unexpectedly." After reviewing the error logs, I found this error: "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))"

I'm not the admin for our server so I have little troubleshooting ability from that side.

If there's any advice you could give on how to get this up and running I would appreciate it.

Thank you

Kassie

 

Translate

Forum|alt.badge.img+2
  • 5 replies
  • June 7, 2019

Hi Caroline,

I want to update a date field. I copied and changed a working web request to update users in the same workflow.
The result is a 400 Http status.
Do you have any idea what I am doing wrong?
Here is a log extract:

Message body: {'__metadata':{'type':'SP.Data.Dokumente_x0020_TR_x0020_HFItem'},'wf_TR_DBearbeiterStart':{'results':[2019-06-07T00:00:00Z]}}

varDBearbeiterStartResult: 400

 

Best regards Micha

Translate

Forum|alt.badge.img+2
  • 5 replies
  • June 11, 2019

Solution: {'__metadata':{'type':'SP.Data.Dokumente_x0020_TR_x0020_HFItem'},'wf_TR_DBearbeiterStart':'2019-06-11T00:00:00Z'}

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings