Nintex Observer

Update a File in Document Library Using REST

Im trying to use a Nintex Call HTTP web service to update a html file in a document library.


Per Microsofts im using 

url: http://site url/_api/web/GetFileByServerRelativeUrl('/Folder Name/file name')/$value
method: POST

body: "Contents of file."
Headers: Authorization: "Bearer " + accessToken
X-RequestDigest: form digest value
content-length:length of post body


The request is working however I am having an issue with the format of the request body. In the request body I simply need to pass in the raw html and nothing else. However due to the Call HTTP web service "request content" only accepting dictionary values I am having difficulty doing this.

img 1.png


This is what is getting put into the file after the request 


img 2.png


All I want the requst to put in there is Hello World.

0 Kudos
2 Replies
Design Canvas Artiste

Re: Update a File in Document Library Using REST

Seems like a lot of complexity.
Why not use Nintex Workflow for O365's "Office 365 upload file"?
Here's the online help for it:
First you'll need to create a connection using a service account with the desired permissions.
0 Kudos
Forms Fledgling

Re: Update a File in Document Library Using REST

The O365 action works but in the content if we use workflow neglects the content and throws the exception " This file is empty and needs content to be uploaded. "


Has anyone found a workarounf for that

0 Kudos