Skip to main content
1-Visitor
January 31, 2018
Solved

upload a file on Thingworx using Postman

  • January 31, 2018
  • 1 reply
  • 2001 views

Hi everybody,

can someone please tell me how to upload a file on Thingworx with Postman. I created a FileRepository Thing and tried to upload the file via POST method in Postman.

I tried following urls:

URL: .../Thingworx/FileRepositories/<MyFileRepositoryThing>/

URL: .../Thingworx/FileRepositories/<MyFileRepositoryThing>/<self created folder>/

URL: .../Thingworx/Things/<MyFileRepositoryThing>/

header:

appKey

Content-Type(tried even differrent types)

Body:

file : XML

Maybe I'm doing it all wrong. It would be great if someone could help.

Best answer by cbuse

Hi,


Use the following URL: .../Thingworx/Things/<MyFileRepositoryThing>/Services/SaveBinary

Use application/json for content type and place appKey in the header

Use JSON payload as follows:

{

    "content" : "<paste Base64 encoding of the file contents here>",

     "path" : "xmlFile.xml"

}

Best regards,

Cristina

1 reply

cbuse13-AquamarineAnswer
13-Aquamarine
January 31, 2018

Hi,


Use the following URL: .../Thingworx/Things/<MyFileRepositoryThing>/Services/SaveBinary

Use application/json for content type and place appKey in the header

Use JSON payload as follows:

{

    "content" : "<paste Base64 encoding of the file contents here>",

     "path" : "xmlFile.xml"

}

Best regards,

Cristina