Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
What's the pattern for calling a creating a custom Event on a thing via the REST API? Not clear from the help/documentation what entity type to reference. I'd have thought something like one of these below would work, but I either get errors or nothing:
TIA.
Solved! Go to Solution.
Looks like the second of my 3 attempts was in the right direction, but we needed to use POST instead of PUT. 'Events' is a valid entity type just like 'Services'. So something more like this works for us:
curl -X POST -H "Content-Type:application/json" -H "Accept:application/xml" -H "appKey:xxx"https://(instance)/Thingworx/Things/MyThing/Events/CustomEvent -d '{"data": "xyz"}'
BTW, can anyone point out where further documentation on such things can be found? I'm sure I must be missing something that would readily answer such questions. The online help didn't make any mention of 'Events' as a valid entity type for instance.
Looks like the second of my 3 attempts was in the right direction, but we needed to use POST instead of PUT. 'Events' is a valid entity type just like 'Services'. So something more like this works for us:
curl -X POST -H "Content-Type:application/json" -H "Accept:application/xml" -H "appKey:xxx"https://(instance)/Thingworx/Things/MyThing/Events/CustomEvent -d '{"data": "xyz"}'
BTW, can anyone point out where further documentation on such things can be found? I'm sure I must be missing something that would readily answer such questions. The online help didn't make any mention of 'Events' as a valid entity type for instance.