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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Get data from ThingWorx API to Display on an HTML File Using JavaScript

jthiede
1-Newbie

Get data from ThingWorx API to Display on an HTML File Using JavaScript

Hello,

I am trying to get data from the ThingWorx API to display on an HTML file so I can use more custom HTML and CSS. I would like to use the simplest ​way possible.

I have tried using ajax, but am getting an error that says: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource." I am not sure how to do this correctly, or if it can even be done.

Ideally I would like to do this using ajax and javascript, but am open to any advice and suggestions.

Thank you,

James

3 REPLIES 3
PaiChung
22-Sapphire I
(To:jthiede)

Thingworx exposes everything as a REST Call.

You should be able to do GET / PUT / POST calls to get information using either an appkey or AUTH

Any content you post should be JSON

What link and type have you tried so far?

Hi,I am facing the Same issue. I tried updating tomcat xml file for CORS. even then i was not able to achieve. If you  have fixed this issue please respond with the fix u provided. 


@jthiede 

 


Thanks,

Avinash

Top Tags