Skip to main content
1-Visitor
Jan 31, 2018 7:51 AM UTC
Solved

upload a file on Thingworx using Postman

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.

cbuseAnswer
13-Aquamarine
Jan 31, 2018 2:34 PM UTC

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
Jan 31, 2018 2:34 PM UTC

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

Translate