Get data from ThingWorx API to Display on an HTML File Using JavaScript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Labels:
-
Troubleshooting
- Tags:
- ajax
- css
- javascript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Also see this Thingworx Doc for some further into on Rest API...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
