Skip to main content
5-Regular Member
November 23, 2015
Question

Using thing Identifers in REST API calls

  • November 23, 2015
  • 4 replies
  • 2258 views

From a recorded presentation I watched by Mike Mahoney regarding the Connection process, I gathered that I should be able to use a thing's Identifier as an (often better) way to manage uniquely referencing a thing from the EMS/REST API calls etc.

Can someone tell me how I would revise REST calls like this to use the identifier (DL1 above) instead of the thing name (Name_DemoDL1) as it is currently doing?

curl -X GET -H "Content-Type:application/json" -H "Accept:application/json" -H "appKey:0a2c50d9-4ed3-40df-aad5-98c57035a204" http://localhost/Thingworx/Things/Name_DemoDL1/Properties/TEMP

Simply swapping the name out for the identifier doesn't seem to work. Is there some other platform service setting I need to enable? Or merely some format for how one specifies to the REST API that it is the identifier you are passing not the name?


TIA.

4 replies

pschmaltz5-Regular MemberAuthor
5-Regular Member
December 3, 2015

I'm still curious to know more about using the thing Identifier in our API calls. TIA if anyone has info about this you can share.

1-Visitor
December 3, 2015

Mike Mahoney was most likely specifically referring to using the identifier to bind the thing to the EMS server as opposed to the thing name.  The REST APIs still require you to use the thing name.

pschmaltz5-Regular MemberAuthor
5-Regular Member
January 27, 2016

I'm not sure it is true that the REST API requires use of thingName and doesn't accept use of the thing Identifier. What I recently learned was that if I added a * in front of the thing Identifier the following URL does work:

http://(your instance)/Thingworx/Things/*ThingIDxyz/Properties

So doesn't that suggest that the REST API knows how to find things via their IDs (not just the thing name) so long as you put a * in front of the thing ID? Or is my test with the above URL not valid?