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

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

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

Tags (3)
3 REPLIES 3

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

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?

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

Highlighted

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

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