Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
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
Solved! Go to Solution.
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.
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.
Thank you, very helpful!