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

Question about creating a thing from REST API

SOLVED
Visitor

Question about creating a thing from REST API

Hi,

I am using a REST API call to create things in our Thingworx instance. However, I am not able to figure out how to add values to the things form the REST for "Project" as well as "Identifier" in the general information section of the thing. Are these properties a part of a Thing Template that I will need in my hierarchy?

Any help would be greatly appreciated!

Thanks,

Tom

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Question about creating a thing from REST API

Good day Thomas,

To set the Project as well as the identifier (and add tags and most other information) you will use POST requests to the services inherited in the Generic Services found from all the templates in a similar way to which you used the POST request to create the Thing.

The specific service to add a Project will be: "SetProjectName" (http://<server>/Thingworx/Things/<ThingName>/Services/SetProjectName).

Similarly for the identifier you will use the SetIdentifier service (http://<server>/Thingworx/Things/<ThingName>/Services/SetIdentifier). (just remember that the identifier is only used with remote things)


To check what inputs are required for the services go to your Generic Services look for what services are available and test them (in the test view you will be able to see what inputs are required and add them to your body of the POST request.

I hope this helped.

p.s. When creating Things over the API or with services beware of Ghost Entities that is created if an error occurs during the creation process (they do mess around with some functionalities like exporting and sometimes creating new things) if you suspect you have Ghost Entities download the GhostEntityRemover tool from the Thingworx Marketplace.

View solution in original post

2 REPLIES 2

Re: Question about creating a thing from REST API

Good day Thomas,

To set the Project as well as the identifier (and add tags and most other information) you will use POST requests to the services inherited in the Generic Services found from all the templates in a similar way to which you used the POST request to create the Thing.

The specific service to add a Project will be: "SetProjectName" (http://<server>/Thingworx/Things/<ThingName>/Services/SetProjectName).

Similarly for the identifier you will use the SetIdentifier service (http://<server>/Thingworx/Things/<ThingName>/Services/SetIdentifier). (just remember that the identifier is only used with remote things)


To check what inputs are required for the services go to your Generic Services look for what services are available and test them (in the test view you will be able to see what inputs are required and add them to your body of the POST request.

I hope this helped.

p.s. When creating Things over the API or with services beware of Ghost Entities that is created if an error occurs during the creation process (they do mess around with some functionalities like exporting and sometimes creating new things) if you suspect you have Ghost Entities download the GhostEntityRemover tool from the Thingworx Marketplace.

View solution in original post

Re: Question about creating a thing from REST API

Thank you, very helpful!

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________