Skip to main content
May 14, 2020 7:46 AM UTC
Solved

Help: How to apply thing shape when creating thing with REST API

Hi,

 

I'm new to REST API and I'm using postman to create things. I tried to apply a thing shape for my thing, but I couldn't make it.

Here is what I post:

eli4_0-1589442277769.png

eli4_1-1589442284034.png

The thing can be created successfully, but the thing shape I want to implement didn't apply to it.:

 

eli4_2-1589442316891.png

 

 

Can anyone help me on this? 

Thanks!

rjanardanAnswer
May 14, 2020 8:22 AM UTC

From ThingWorx, if you navigate to Resources -> EntityServices -> CreateThing you will see that it takes only 4 inputs none of which is a Thing Shape. 

name
description
tags
thingTemplateName
In order to add ThingShape to Thing, make a POST call to AddShapeToThing. 

2 replies

rjanardanAnswer
May 14, 2020 8:22 AM UTC

From ThingWorx, if you navigate to Resources -> EntityServices -> CreateThing you will see that it takes only 4 inputs none of which is a Thing Shape. 

name
description
tags
thingTemplateName
In order to add ThingShape to Thing, make a POST call to AddShapeToThing. 
eli4Author
May 14, 2020 8:28 AM UTC

Thanks! That's the solution!