cancel
Showing results for 
Search instead for 
Did you mean: 
Paul1991
Nintex Newbie

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 https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest 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
X-HTTP-Method:"PUT"
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.

Labels: (1)
Tags (1)
0 Kudos
Reply
1 Reply
v-tmasenko
Nintex Newbie

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: https://help.nintex.com/en-US/O365/Default.htm#cshid=NLF80DDBC5F51D444B97BC69614485503B
First you'll need to create a connection using a service account with the desired permissions.
0 Kudos
Reply