Events

Location /api/apps/{appID}/events
Resource for Flex Analytics event raw data.

Request Headers (Applies to all methods)

Authorization
header
Required: Yes

POST

/api/apps/{appID}/events

Description

Post event data

Content-Type application/vnd.kii.EventRecord+json

Post one or multiple event data.

Use the Content-Type "application/vnd.kii.EventRecord+json" if you are sending a single event data. If you are sending a list of event, send them as an array with the Content-Type "application/vnd.kii.EventRecordList+json".

Headers
Name Required? type Description
Authorization Yes string Authorization can be of type Basic or Bearer.
  • Authorization Basic: header for granting an anonymous access.
    • Set a Base64-encoded string of AppID and AppKey concatenated with a colon (APP_ID:APP_KEY).
    • The header should look like:
      Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
  • Authorization Bearer: using Oauth2 Bearer Token.
    • The header should look like:
      Authorization: Bearer ht5fpHQAyrPPwLftK1rAqllv5WNVPCnYfPiCvPocFuQ
Params
Name Required? Type Description
_deviceID string The deviceID of the device that sends the event data.
_type string The event type. You can use the value to later filter the event data.
_triggeredAt long The time when the event has occurred (UNIX time in msec, UTC).
_uploadedAt long The time when the event was uploaded (UNIX time in msec, UTC).
Sample Request
{
  "_deviceID": "[string]",
  "_type": "[string]",
  "_triggeredAt": "[long]",
  "_uploadedAt": "[long]"
}
Responses
204

Content-Type (None)

The event is recorded successfully
Note This response has no contents.
400

Content-Type application/vnd.kii.InvalidJSONException+json

JSON data has syntax errors
Contents
Name Type Description
errorCode string Error code "INVALID_JSON".
message string The error message.
400

Content-Type application/vnd.kii.ValidationException+json

User data has validation errors
Contents
Name Type Description
errorCode string Error code "INVALID_INPUT_DATA".
message string The error message.
401

Content-Type application/vnd.kii.UnauthorizedAccessException+json

The request was not authorized.
Contents
Name Type Description
errorCode string Error code "UNAUTHORIZED".
message string The error message.
authenticatedAppID string The authenticated appID.
authenticatedPrincipalID string The authenticated principal ID (userID or thingID).