cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

How to use Importer to import a XML file

htran-21
15-Moonstone

How to use Importer to import a XML file

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

1 ACCEPTED SOLUTION

Accepted Solutions
PaiChung
22-Sapphire I
(To:htran-21)

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?

https://www.ptc.com/en/support/article?n=CS284714&language=en&posno=9&q=importer&ProductFamily=ThingWorx&source=search

If it didn't succeed I would check the Thingworx Application Log

View solution in original post

2 REPLIES 2
PaiChung
22-Sapphire I
(To:htran-21)

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?

https://www.ptc.com/en/support/article?n=CS284714&language=en&posno=9&q=importer&ProductFamily=ThingWorx&source=search

If it didn't succeed I would check the Thingworx Application Log

htran-21
15-Moonstone
(To:PaiChung)

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

Top Tags