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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Redirection / Parameters in the URL

gch
13-Aquamarine
13-Aquamarine

Redirection / Parameters in the URL

Hi,


A third part product send a rest rest call to Thingworx with the following formatting: "equipment/instance/{id}/state"
I need a solution (inside or outside tomcat) to transform the Rest call to something that Thingworx will accept, e.g. /Things/MyThingName/Services/getState?id={id}"

Is there an easy way to do this?

Thanks!

ACCEPTED SOLUTION

Accepted Solutions
gch
13-Aquamarine
13-Aquamarine
(To:PaiChung)

Alright thanks!

I added a reverse proxy (Nginx) in my infrastucture to handle this. I configured a 'rewrite' and I tested it using curl. It seems to be working well also using the basic Auth / -u in curl. 

View solution in original post

6 REPLIES 6
PaiChung
22-Sapphire I
(To:gch)

The service that you provide to ingest this rest call should be able to take the content and parse that.

Not exactly sure if you are saying that the third party can only send information as a specific 'URL' only without content.

gch
13-Aquamarine
13-Aquamarine
(To:PaiChung)

The 3Part service can only send Rest Call of type "equipment/instance/{id}/state". 

But Thingworx doesn't have any Thing named {id}, the id should be pass as a parameter, this is my issue.

PaiChung
22-Sapphire I
(To:gch)

That unfortunately is a very limited ability. Are you sure that is the only capability this device has? What device is this?

Also this is a GET? How would you include authentication (appkey)?

gch
13-Aquamarine
13-Aquamarine
(To:PaiChung)

We are talking about a robot. The provider do not want to recompile the robot system so we need to implement a solution on our side. The authentication used is Basic Auth. 

PaiChung
22-Sapphire I
(To:gch)

With those limitations, you may need to put something in between as a translation layer.

gch
13-Aquamarine
13-Aquamarine
(To:PaiChung)

Alright thanks!

I added a reverse proxy (Nginx) in my infrastucture to handle this. I configured a 'rewrite' and I tested it using curl. It seems to be working well also using the basic Auth / -u in curl. 

Announcements


Top Tags