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+9
  • Author
  • Scholar
  • 399 replies
  • August 28, 2017

Sorry I haven't read the last version of your post .

Have you tried to get and then upload the file content using this web request:

http://site url/_api/web/lists/getbytitle('list title')/items(item id)
/AttachmentFiles('file name')/$value
Translate

Forum|alt.badge.img
  • 4 replies
  • August 28, 2017

Thank you for the quick response, Caroline. I think I am getting close with the documents you have sent me, but I am really new to REST (I hadn’t even heard of it before last Friday). How do I “translate” this into the Web Request action of a Nintex workflow? How do I get “content-length”?

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • August 29, 2017

Actually this web request works without "content-length" header.

Do you use Nintex for O365 or for SharePoint?

Translate

Forum|alt.badge.img
  • 4 replies
  • August 29, 2017

We are using Nintex for SharePoint.

I used the links you sent to retrieve the attachment using the /$value, and saved it to a string variable. When I tried to do the POST Web request using that variable and the /$value, it gave me an error that the Uri string is too long. When I retrieve the attachment, should I be saving it to a string variable or doing something else with it when it is returned?

I can’t tell you how much I appreciate you helping me with this. Thank you!

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • August 29, 2017

If you get an error regarding a too long url, then you need to increase the maxUrlLength attribute of httpRuntime element in the web.config of the SharePoint web application executing your workflow (if the workflow is scheduled it's the

OWSTIMER.EXE.config instead of the web.config): https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.100).aspx.

The string variable should be ok to store the attachment content.

Hope this helps

Translate

Forum|alt.badge.img+1

Hey,

Thanks a lot for this post.

Any idea to call a API with a OAuth authentication ?

Thanks,

Damien

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • September 22, 2017

Forum|alt.badge.img+5
  • 45 replies
  • November 9, 2017

Caroline, I have read this thread with great interest.  I've have been trying to get the "accept-language" header value in workflow using the Web Call action with no success.  We need to use the result to set the language for labels on task forms and notifications.  I must be missing something simple.  My response contains no reference to the "accept-language" header.

Any suggestions?

-Ken

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • November 13, 2017

Hi Ken,

It seems that SharePoint REST API calls don't return any accept-language header.

What do you want to do exactly? Maybe we can find a workaround...

Translate

Forum|alt.badge.img+5
  • 45 replies
  • November 16, 2017

Thanks Caroline, but we decided to scrap the function involved.

Regards,

Ken

Translate

Forum|alt.badge.img+3
  • 10 replies
  • November 16, 2017

Hi Caroline,

Thank you for the nice blog. I have followed all the steps to update a document in library. The REST API call to fetch the item  was excuted without any error. But I don't see that column s are updated. No error in the logs as well.

The body looks like as follows. None of the column is updated.

 '__metadata' : { 'type' : '{WorkflowVariable:ListName}'},
     'Textcolumn' : 'Complete',
'choicecolumn' : 'No',
'Date Column' : '{Common:CurrentDate}'
}

Any help?

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • November 20, 2017

Hi Rashmi,

Can you share the url that you're using to perform the request?

Translate

Forum|alt.badge.img+3

Hi Caroline,

I am looking for help to understand the chekcout, update and checkin REST API calls for a document in the document library.

1. I want to know how do we overide the checkout. I am using a site collection workflow. Does the just checkout REST API call will override the checkout?

2. I am checking out the document and updating the metadata using update REST API and checkin using REST API.

But I don't see the meta data is getting updated.

If I use only UPDATE REST API without any checkout and checkin, it works - metadata gets updated

Any idea about this behavior. What should I be doing to update the metadata along with checkout and checkin. I should be able to update the document from the workflow even if it is already checked out.

Thanks

Rashmi

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • December 14, 2017

Hi Rashmi,

Unfortunately, I haven't worked so far with check-in and check-out REST API calls.

I'm afraid I can't help you a lot with that.

Did you finally get a solution?

Translate

Forum|alt.badge.img+3
  • 10 replies
  • December 15, 2017

Hi Caroline,

I was able to resolve the check out and check in requirements using REST API calls. Here is the example for the REST API URL,

Checkout -

{WorkflowVariable:WebURL}/_api/web/GetFileByServerRelativeUrl('/sites/WorkflowVariable:ServerRealtiveURLofPage}')/CheckOut()

Update Item by REST API

Checkin - {WorkflowVariable:WebURL}/_api/web/GetFileByServerRelativeUrl'/sites/WorkflowVariable:ServerRealtiveURLofPage}')/CheckIn(checkintype=1)

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • December 15, 2017

Great

Thanks for sharing this !

Translate

  • 1 reply
  • February 14, 2018

Hi Caroline,

I'm getting an issue during GET operation stating : Workflow Status

Error performing web request. The underlying connection was closed: An unexpected error occurred on a send.

Below is the screen shot of the configuration which I did to achieve the same.

Please let me know what I'm doing wrong here.

Regards,

Akram

Translate

Forum|alt.badge.img+9
  • Author
  • Scholar
  • 399 replies
  • February 15, 2018

Hi Akram,

I think that this error is related to server/network configuration. If you try to execute this request directly from the SharePoint server, I think that you will get the same error.

Does the SharePoint farm have multiple front servers? If yes, is there a load balancer?

The better way to solve this issue is to check with an administrator in the event viewer of the SharePoint server if there are more details.

Hope this helps,

Caroline

Translate

Hi Caroline,  I am working on a web request to the REST API that will update a Hyperlink Column.  I went through all of the steps that both you and Tomasz laid out SAML Request, Response Message, but there's no BinaryRequestToken element in the response.  

SAML RESPONSE

SAML RESPONSE

So I tried grabbing the innerXML from the X509SKI element instead.  Sent that in and get the Response Headers back.  The I log them all out to find the Cookie Header (which accoring to Tomaz is Index Item #6) and it's not there. Is this solution still valid?

 

Thanks,

Mario

Translate

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

Hi Mario,

I'm afraid I can't help with that but I'm sure that ‌ can

Translate

TomaszPoszytek
Forum|alt.badge.img+17

What env. are you working in? I see a SPO term in your screenshots, so possibly this is O365

This is not a BinaryRequestToken, but BinarySecurityToken:

Try to post your SAML Request Security Token using Postman for example, to see the response. I just did it and I've been received that token.

Also using Postman you will have the possibility to preview, whether this way of authentication is even allowed - I have access to three tenants, on two of them this is disallowed. Possibly because of some policy settings or MFA.

Regards,

Tomasz

Translate

Thanks Tomasz,

The client has a dedicated Office 365 tenant and they indeed have MFA enabled. Thanks for the reply I will pass this along.

Mario

Translate

Forum|alt.badge.img+3

Hi Caroline,

I need your help please. I wanted to update the datefield, but its throwing some error

{
"__metadata": { "type": getItemTypeForListName(listName) },
"Title": "firsdt",

"ApplicatinDate" : "{ItemProperty:ApplicationDate}"

}

i tried converting iso format and assign it, but in vein

{
"__metadata": { "type": getItemTypeForListName(listName) },
"Title": "firsdt",

"ApplicatinDate" : "{WorkflowVariable:ISOConvertedDate}"

}

getting below error

Error performing web request. <?xml version="1.0" encoding="utf-8"?><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">I

Pelase suggest to me how to save date field and person or group

Translate

Forum|alt.badge.img+3

Url i am using is : 

Web URL/_api/web/lists/getbytitle('txtListName')/items

I am able to save other fields except date and person group

Translate

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

Hi Vijay,

Can you send me the complete error message? In the workflow, you can send you an email with the error message in the body and set the body to be in plain text instead of rich text.

To update a date column, the json should look like this :

'StartDate':'2014-01-29T08:00:00Z'

Can you send me the value of the variable "ISOConvertedDate"?

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