Skip to main content
10-Marble
Jun 26, 2024 6:00 AM UTC
Solved

Where does API GET request fetches data ?

After some time being working with Thingworx APIs I would like to know a bit more about their internal functionality.

 

When i make a get request , how Thingworx handles this ? at which level? if anyone can explain the logics of how this works internally , it would be of a good help 

 

Many thanks 

 

19-Tanzanite
Jul 1, 2024 10:42 AM UTC

Understood. In this case you must reach out to the internal IT security team in your company and ask them to whitelist the domain name+base url (eg: mythingworxserver/Thingworx/*) for the machine where you're executing those requests (that docker infrastructure).

You can ask them to whitelist "/Thingworx/Things/Machine_name/Properties/" but only if you're 100% sure that's the only request you'll ever make from that machine - up to you to decide.

 

The error you see can be caused by many things, I believe probably by the fact the VSCode inside that Docker is not able to reach out to the platform. That's 100% IT security job. ( It says timed out, but the issue is that for that endpoint you should have almost instant response back. 504 is gateway timeout error, which means that from proxy's perspective the TW server is not replying).

 

Note that once this issue is fixed, then maybe we can have a separate discussion on which API to choose to push data to InfluxDB (in this approach you'll loose data if the rate of accessing that endpoint is higher than the rate data is sent to ThingWorx).

10 replies

ShirishMorkhade
16-Pearl
Jun 26, 2024 10:15 AM UTC

Hi @Lo_ry96 ,

I believe if you can share an example of what GET request you're referring to, then me be it will help the audience here to relate and understand your requirement/use case.

Regards,

Shirish

Translate
Lo_ry9610-MarbleAuthor
10-Marble
Jun 26, 2024 2:31 PM UTC

hello, 

 

yes sure. I want to fetch data from Thingworx via API requests like this : GET https://<mythingworxplateform.com>/Thingworx/Things/<my_machine>/Properties/

 

Now, as i'm in corporate environment , my API requests are blocked from the proxy. So i want to know exactly the mechanism of Thingworx API and what access should be given in FW or other so that i can ask IT team to do the needed things so that i can execute my requests normally. 

 

I hope that things are more clear. 

 

Best regards, 

 

Translate
17-Peridot
Jun 27, 2024 12:54 PM UTC

The REST API is just leveraging normal https protocol - in your sample URL you host it on the default https port 443 (as it is not specified). So you would need to allow access for https requests for your instance <mythingworxplatform.com>.

 

Depending on what you want to do with the API you will do GET, POST, PUT, DELETE requests. Also see related docs to TWX REST API: https://support.ptc.com/help/thingworx/platform/r9.5/en/#page/ThingWorx/Help/REST_API/UpdatingDeletingandExecutingThroughtheAPI.html# 

Translate