User Tools

Site Tools


version_1:post_events

Sending new event data

An event consists of an action (START, UPDATE or END), a type, the timestamp when the event happened and an arbitrary amount of key-value pairs (in this case: title-value pairs) as items. This interface of the service is able to process as much events as a POST request is able to handle.

Authentication required

Yes, please take a look at Authentication. To keep it simple, only the data parameter is mentioned on this page, but keep in mind that the other parameters are also necessary.

Response

JSON

Method

POST

Resource URL

Parameters

The sent JSON object data consists of an array of events. It is not possible to just send one event, it has to be an array of event(s). One event should contain the following parameters:

action

Can be START, UPDATE or END. For recurring events, like the changes in the position, UPDATE should be used. If there is a start and end point, like the usage of a certain application, START and END should be used.

type

The service knows a fixed number of types. As a developer, you have to decide which type to choose for an event.

timestamp

The (UNIX) timestamp when the event happened.

items

This is an array of arbitrary length containing key-value pairs which can be used to describe the event (what happened). One item consists of two parameters:

title

The name of the variable.

value

The value of the variable, can be of any type, from Integer to String to Binary.

Example

Request

data=[
   {
      "action":"START",
      "type":"APPSTART",
      "timestamp":1365772427,
      "items":[
         {
            "title":"app",
            "value":"BigBrother"
         },
         {
            "title":"package",
            "value":"de.thues.bigbrother"
         }
      ]
   },
   {
      "action":"END",
      "type":"APPSTART",
      "timestamp":1365772533,
      "items":[
         {
            "title":"app",
            "value":"BigBrother"
         },
         {
            "title":"package",
            "value":"de.thues.bigbrother"
         }
      ]
   }
]

Response

{
   "APIVersion":1,
   "result":1
}

version_1/post_events.txt · Last modified: 01.05.2016 21:36 (external edit)