Skip to main content
Sep 29, 2020 9:12 AM UTC
Solved

Setting thing shape with rest api

Hi,

Is there a way to set thing shape with rest api as we set thing template? I tired with "thingShapeName" in the Request body of create thing rest api but its not working.

 

nmillesonAnswer
Sep 29, 2020 10:50 AM UTC

There is a service under Resources/EntityServices called AddShapeToThing that takes two parameters.  If you're calling it via the rest api, you'll likely need to ensure the Thing has been created (and usually re-started using the RestartThing() service if you're creating it via the api) before calling the above service.

5 replies

nmillesonAnswer
Sep 29, 2020 10:50 AM UTC

There is a service under Resources/EntityServices called AddShapeToThing that takes two parameters.  If you're calling it via the rest api, you'll likely need to ensure the Thing has been created (and usually re-started using the RestartThing() service if you're creating it via the api) before calling the above service.

Sep 29, 2020 10:56 AM UTC

yeah I got it! Will try and get back to you.

 

Thanks!

Sep 29, 2020 11:01 AM UTC

@MM_9628870 ,

 

Try this link:

 

<yourTWxServer>/Thingworx/Resources/EntityServices/ServiceDefinitions/

 

There you should see AddShapeToThing()