1 Reply Latest reply on Dec 30, 2015 9:24 PM by petersch RSS
    petersch Apprentice

    Creating Events via the REST API?

    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:




      • Re: Creating Events via the REST API?
        petersch Apprentice

        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.