Skip to main content
1-Visitor
October 28, 2020
Solved

Unable to execute services of any entity using Rest Api Call

  • October 28, 2020
  • 2 replies
  • 2494 views

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.

Best answer by Ciprian-Traian

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,

2 replies

16-Pearl
October 28, 2020

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

 

5-Regular Member
October 28, 2020

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.

ranjank1-VisitorAuthor
1-Visitor
October 28, 2020

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.

5-Regular Member
October 28, 2020

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,