Skip to main content
4-Participant
January 31, 2023
Solved

How to make a REST request for retrieving data

  • January 31, 2023
  • 1 reply
  • 3807 views

Hi friends!

 I have a question/doubt about IoT Gateway's REST Client:  

 

How can I make a GET request from REST Client in order to retrieve some data from an external API (e.g. Weather, web application, etc)?.

 

As you know, it only supports PUT & POST method and it's fine but what about if I want to connect to Google Maps, Open Trivia  or AccuWeather  and retrieve/handle some values??

GV_10573671_0-1675181868491.png

 

Even, I have a Google sheet's script deployed as web application listening external calls to log data in my sheet and I just need a simple GET request to achieve it but I can't find a way to do it from IoT Gateway module. My URL to get this is: 

"https://script.google.com/macros/s/ SCRIPT_ID/exec?temp1=1234&level=122&pressure=88"

 

What would be the procedure or module to achieve it?

 

Thanks in advance for your prompt reply and help,

 

Saludos!

 

 

 

 

 

Best answer by VladimirRosu_116627

I suggest reviewing the IoT Gateway User Manual, available here.

In short, the IoT Gateway is a plugin that is used in Kepware to publish tag values (through different methods, like REST or MQTT).

Any sort of custom coding is not its intended use-case (generally speaking).

ThingWorx on the other hand is an Industrial IoT Platform (description here), where you can build applications for a variety of use-cases.

The use-case you shared is something that ThingWorx would help you to do, as it contains something ContentLoader snippets that allow you to execute GET,POST,PUT and then use it in Javascript to your liking.

 

ThingWorx and Kepware are very different, though it is worth mentioning that Kepware can be integrated in ThingWorx out of the box, via a native integration capability (you can receive tag values in ThingWorx directly, can modify a Kepware configuration directly from TW).

1 reply

5-Regular Member
January 31, 2023

Hello @GV_10573671 

You may refer the following articles for the Rest API services:

 

https://www.ptc.com/en/support/article/cs329281

https://www.ptc.com/en/support/article/cs224211

 

Pls let me know if it works for you.

Regards

Bhawna

4-Participant
January 31, 2023

Thanks Bhawna! 

 

I will try using Thingworx.  I thought that using IoT Gateway was enough to do what I want.

 

But now I have a doubt:  when would I have to use IoT Gateway instead of Thingworx?

Is Thingworx the IoT Gateway's older bother ?  Is it more expensive? 

 

Have a great day!

Gavp

19-Tanzanite
February 1, 2023

I suggest reviewing the IoT Gateway User Manual, available here.

In short, the IoT Gateway is a plugin that is used in Kepware to publish tag values (through different methods, like REST or MQTT).

Any sort of custom coding is not its intended use-case (generally speaking).

ThingWorx on the other hand is an Industrial IoT Platform (description here), where you can build applications for a variety of use-cases.

The use-case you shared is something that ThingWorx would help you to do, as it contains something ContentLoader snippets that allow you to execute GET,POST,PUT and then use it in Javascript to your liking.

 

ThingWorx and Kepware are very different, though it is worth mentioning that Kepware can be integrated in ThingWorx out of the box, via a native integration capability (you can receive tag values in ThingWorx directly, can modify a Kepware configuration directly from TW).