-
Notifications
You must be signed in to change notification settings - Fork 0
App Log API
Welcome to the Data Cortex API version 1.
This API allows ingest of events into the Data Cortex analytics engine.
All calls are made on the standard data ingestion endpoint:
https://api.data-cortex.com
Calls to the API are made with a POST to the API endpoint.
POST /<org>/1/app_log
<org> - string - Should be replaced with the organization short name.
The request should contain a JSON body. The client should be sure to set the the Content-Type header to "application/json". The body is considered a "bundle". Each bundle can contain multiple events. The bundle has global properties and then a list of events.
The body should have the following structure:
{
/* global properties */
"api_key": "xxxx",
/* ... */
"events": [ ... ]
}
The events list may be omitted for a single app log line. It may have up to 100 items in the list.
The API responds with the following depending on the result.
Events have been successfully processed.
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 2
Date: Sun, 10 Nov 2013 04:24:17 GMT
OK
Bad request. Check with Data Cortex documentation and verify that you are sending all required fields and valid data types in those fields. A bad request will result in a row in the ingest_error_log table that can be used to debug the problem.
HTTP/1.1 400 Bad Request
Bad API key. Check with Data Cortex and verify your API key. Productions clients should treat this as a fatal error and remove all events queued.
HTTP/1.1 403 Forbidden
Internal server error. Clients should treat these as soft errors and resend the request.
HTTP/1.1 500 Internal Server Error
The bundle has the following global properties.
api_key - string - The api key specific to this application. Applications can have more than 1 API key, but can not be shared between applications.
app_ver - string - (optional) The version of the application. 16 character maximum.
hostname - string - (optional) The hostname for the log line. 64 character maximum.
filename - string - (optional) The filename for the log line. 256 character maximum.
log_level - string - (optional) The hostname for the log line. 64 character maximum.
device_tag - string - (optional) A unique ID for the device. IDFA for iOS, MAC Address for Android, a randomly generated value for the browser stored in a cookie or localStorage. 62 character maximum. Also see user anonymized data.
user_tag - string - (optional) A unique ID for the user. Should only be inserted if the application is able to determine a unique stable user identity. User tags should be unique per user across the organization. If they are not unique for a particular organization, they should be prefixed per application to make them unique. 62 character maximum. Also see user anonymized data.
remote_address - string - (optional) The IP address of the request.
response_bytes - int - (optional) The number of bytes in the response.
response_ms - float - (optional) The processing time for the response.
device_type - string - (optional) type of device. 16 character max. e.g.
desktop, iphone, iphone3g, iphone4, iphone5s, iphone5c, android
os - string - (optional) The OS of the device. 16 character max. e.g.
ios, mac, windows
os_ver - string - (optional) The OS version. 16 character max.
browser - string - (optional) The browser in use. 16 character max.
browser_ver - string - (optional) The browser version. 16 character max.
country - string - (optional) The uppercase 2 letter ISO 3166-1 alpha-2 country code of the event.
language - string - (optional) The lowercase 2 letter ISO 639-1 language code.
log_line - string - (optional) The log line. 65535 character max.
events - list of objects - (optional) A list of events. Any property can be present in the objects in this array and will override the property in the base bundle.
If the client encounters an error when sending to the backend service it should make sure to not resend the request immediately. At a minimum it should wait 30 seconds between attempts. Ideally the client should implement random exponential backoff.