Send an event with flat parameters
const url = 'https://restapi.affattr.com/v1/external_data/add_simple_event';const options = { method: 'POST', headers: {'API-KEY': '<API-KEY>', 'Content-Type': 'application/json'}, body: '{}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://restapi.affattr.com/v1/external_data/add_simple_event \ --header 'API-KEY: <API-KEY>' \ --header 'Content-Type: application/json' \ --data '{}'Add_event for callers that can only send flat key-value pairs (a postback URL of a network): query parameters and/or a flat JSON object. Field names and aliases are listed in the Events tag. The time of the event is always the time of the request. Client API key only.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Device id (alias device_id)
Install id
Click id
Click id of the partner
Application id
First launch, unix seconds or milliseconds
Event name (aliases affise_event_name, event)
Request Body
Section titled “Request Body ”The same fields as a flat JSON object
object
Example generated
{}Responses
Section titled “ Responses ”Accepted
object
Set when the request was rejected.
object
Example
{ "error": { "text": "event from future" }, "request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"}Rejected: error.text tells why
object
Set when the request was rejected.
object
Example
{ "error": { "text": "event from future" }, "request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"}No credentials (answered with 403 until default-deny is enabled)
object
What went wrong. 403 always says “Access denied”.
Id of the request, to quote to support.
Example
{ "error": "Access denied", "request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"}Invalid credentials or application of another client
object
What went wrong. 403 always says “Access denied”.
Id of the request, to quote to support.
Example
{ "error": "Access denied", "request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"}Internal server error
object
What went wrong. 403 always says “Access denied”.
Id of the request, to quote to support.
Example
{ "error": "Access denied", "request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"}