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

Unable to execute services of any entity using Rest Api Call

ranjank
14-Alexandrite

Unable to execute services of any entity using Rest Api Call

Hi Team,

 

I am not getting any option of "Services" to execute the services using REST Call.

 

I am trying to execute service using both GET/POST request for below Url:-

http://localhost:8080/Thingworx/Things/ThingName/Services/<ServiceName>

 

But I am not getting any option of "Services" , that'swhy it is showing response as "Invalid Request".

 

Screenshot has been enclosed.

Please let me know how to enable Services execute option using in ThingWorx For Rest Call.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @ranjank,

 

If you invoke services of one ThingWorx in another ThingWorx instance , you can use "PostJSON()" of ContentLoaderFunctions resource and for getting property values you use "GetJSON()"

 

Hope it helps,

View solution in original post

4 REPLIES 4
odukiya
15-Moonstone
(To:ranjank)

Hello @ranjank 

 

Please refer the following article 

 

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

 

Let me know if it doesn't resolve your issue.

 

Thanks

Om Dukiya

 

Hello @ranjank,

 

To enable execution of services using Rest Api, in the case of

http://localhost:8080/Thingworx/Things/ThingName/Services/<ServiceName>

a POST needs to be used in Postman.

 

To retrieve a property value you would need to use http://localhost:8080/Thingworx/Things/ThingName/Properties/PropertyName/

a GET needs to be used in Postman.

ranjank
14-Alexandrite
(To:Ciprian-Traian)

Hi @Ciprian-Traian ,

 

So that means for getting Property value, I have to use "GetJSON()"

and for service execute, I have to use "PostJSON()" of ContentLoaderFunctions resource.

 

Please correct me If I am wrong.

Hello @ranjank,

 

If you invoke services of one ThingWorx in another ThingWorx instance , you can use "PostJSON()" of ContentLoaderFunctions resource and for getting property values you use "GetJSON()"

 

Hope it helps,

Top Tags