Menu

SendEvent

Jim

Send Event

Events are sent in the domain of the owner identified by the apikey. Each event consists of a timestamp, as set of attribute values and a raw data attribute. This service allows to send one event for a device. Events must be defined according to the event model of the sending device. Timestamp has to be given in the same time zone as the server time. Get Time should be used to get the server time. If the timestamp is not given the reception time at the server is taken as timestamp.

Path: cs-ws/resources/event Method: POST

Parameters

  • apikey
  • device_name
  • eventmodel_name

Data

    <event>
        <attribute>
            <name>...</name>
            <value>...</value>
        </attribute>
        ...
        <model>...</model>
        <rawdata>this is the raw data</rawdata>
        <timestamp>YYYY-MM-DD hh:mm:ss.SSS</timestamp>
    </event>

Errors:

  • 401 UNAUTHORIZED if key is invalid or not admin key
  • 404 NOT FOUND if device or attributes do not exist

Example

POST http://localhost/cs-ws/resources/event?apikey=1234&eventmodel_name=EvModel1&device_name=Test1 HTTP/1.1
    <event>
        <attribute>
            <name>EvAttr1</name>
            <value>123</value>
        </attribute>
        <attribute>
            <name>EvAttr2</name>
        </attribute>
        <model>EvModel1</model>
        <rawdata>this is the raw data</rawdata>
        <timestamp>2017-12-04 12:10:30.123</timestamp>
    </event>

HTTP/1.1 200 OK

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.