Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi,
I wonder if it is possible to import a XML file by using REST API
"
POST /Thingworx/Importer?purpose=import& usedefaultdataprovider=false& WithSubsystems=false HTTP/1.1
Host: <<server>>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Accept: */*
Authorization: Basic <<base64>>
cache-control: no-cache
Content-Disposition: form-data; name="file"; filename="R:\TestProject\Things\TestFeature1.xml
------WebKitFormBoundary7MA4YWxkTrZu0gW--
"
I tried a HTTP request above, but it did not work :(
My Bests,
Hung Tran
Solved! Go to Solution.
The importer service is for importing Thingworx entities, I am assuming that is what you are doing. (to load xml content and parse use the content loader functions)
Did you get your setup from this article?
If it didn't succeed I would check the Thingworx Application Log
The importer service is for importing Thingworx entities, I am assuming that is what you are doing. (to load xml content and parse use the content loader functions)
Did you get your setup from this article?
If it didn't succeed I would check the Thingworx Application Log
Hi PaiChung,
Thank you very much, that is exactly what I am looking for. I figured out that Content-Type must be text/xml instead of multipart/form-data.
My Bests,
Hung Tran