Skip to content

Send an in-app event or an install

POST
/v1/external_data/add_event
curl --request POST \
--url https://restapi.affattr.com/v1/external_data/add_event \
--header 'API-KEY: <API-KEY>' \
--header 'Content-Type: application/json' \
--data '{ "adid": "example", "advertiser_tracking_enabled": true, "affise_device_id": "0b5b4d0e-7d4c-4a3c-9f62-2f7a1d1c0c11", "affise_sdk_version": "example", "api_level_os": "example", "app_id": 123, "app_version": "example", "application_tracking_enabled": true, "click_id": "example", "country": "DE", "device_name": "example", "event": { "affise_event_category": "example", "affise_event_data": { "additionalProperty": "example" }, "affise_event_first_for_user": true, "affise_event_id": "4f8a7c1e-2b9d-4c55-9a51-0d6f3e2a7b10", "affise_event_name": "Purchase", "affise_event_timestamp": 1793527620, "affise_event_user_data": "example", "affise_parameters": { "additionalProperty": "example" } }, "first_open_time": 1793527500, "gaid_adid": "example", "gen_from_click": true, "idfa": "example", "idfv": "example", "ip": "example", "ips": [ "example" ], "language": "example", "os_name": "example", "os_version": "example", "partner_id": 1, "partner_name": "example", "partner_upsert": true, "platform": "example", "pub_click_id": "example", "random_user_id": "9a4f0f5e-31d2-4c5b-8a0b-7e7d0f1c2b3a", "referrer": "example", "sandbox": true, "sdk_platform": "example", "timezone_dev": "example", "ua": "example", "user_agent": "example" }'

Server-to-server event of a device: creates the install when no install is found (app_id and first_open_time required for that) and publishes the in-app event of event. The parameters are taken from the JSON body and from the query (dotted names, event.affise_event_name). Client API key only. See the Events tag for the time fields and the differences from the SDK.

Event

Media type application/json
object
adid

IDFA, a UUID.

string
advertiser_tracking_enabled

ATT status (iOS); absent keeps the stored value.

boolean
affise_device_id

Device id, a UUID.

string
Example
0b5b4d0e-7d4c-4a3c-9f62-2f7a1d1c0c11
affise_sdk_version
string
api_level_os
string
app_id

Application. With first_open_time a new install is created when no install is found.

integer
Example
123
app_version
string
application_tracking_enabled

LAT status; absent keeps the stored value.

boolean
click_id

Click of the tracking link to attribute the install to.

string
country

ISO 3166-1 alpha-2; overrides the geo of the ip.

string
Example
DE
device_name
string
event

The in-app event. Without it the request only creates (or updates) the install.

object
affise_event_category

Ignored: the category is always “external”.

string
affise_event_data

Not used.

object
key
additional properties
affise_event_first_for_user
boolean
affise_event_id

Id of the event, a UUID; generated when absent or not a UUID.

string
Example
4f8a7c1e-2b9d-4c55-9a51-0d6f3e2a7b10
affise_event_name

Event name, letters and digits; a client event name is accepted too.

string
Example
Purchase
affise_event_timestamp

Time of the event, unix seconds, milliseconds or microseconds (detected by magnitude). 0 or absent: the time of the request. More than 5 minutes in the future: 400.

integer
Example
1793527620
affise_event_user_data
string
affise_parameters

Event parameters, a flat object: affise_p_revenue, affise_p_currency and others.

object
key
additional properties
first_open_time

First launch after the install, unix seconds or milliseconds. See the Time section.

integer
Example
1793527500
gaid_adid

GAID, a UUID.

string
gen_from_click

Build the install from the click found by ip (probabilistic).

boolean
idfa

Alias of adid.

string
idfv

IDFV, a UUID.

string
ip

IP of the device.

string
ips

More ips of the device for probabilistic attribution, tried after ip.

Array<string>
language
string
os_name
string
os_version
string
partner_id

Partner of the install when nothing else attributes it.

integer
partner_name
string
partner_upsert

Create the partner named partner_name when nothing else attributes the install.

boolean
platform
string
pub_click_id

Click id of the partner to attribute the install to.

string
random_user_id

Install id, a UUID; a new one for a known affise_device_id is a reinstall.

string
Example
9a4f0f5e-31d2-4c5b-8a0b-7e7d0f1c2b3a
referrer

Install referrer.

string
sandbox

The event comes from a test device: environment sandbox.

boolean
sdk_platform
string
timezone_dev
string
ua

User agent of the device.

string
user_agent

Alias of ua.

string

Accepted

Media type application/json
object
error

Set when the request was rejected.

object
text
string
request_id
string
Example
{
"error": {
"text": "event from future"
},
"request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"
}

Rejected: error.text tells why

Media type application/json
object
error

Set when the request was rejected.

object
text
string
request_id
string
Example
{
"error": {
"text": "event from future"
},
"request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"
}

No credentials (answered with 403 until default-deny is enabled)

Media type application/json
object
error

What went wrong. 403 always says “Access denied”.

string
request_id

Id of the request, to quote to support.

string
Example
{
"error": "Access denied",
"request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"
}

Invalid credentials or application of another client

Media type application/json
object
error

What went wrong. 403 always says “Access denied”.

string
request_id

Id of the request, to quote to support.

string
Example
{
"error": "Access denied",
"request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"
}

Internal server error

Media type application/json
object
error

What went wrong. 403 always says “Access denied”.

string
request_id

Id of the request, to quote to support.

string
Example
{
"error": "Access denied",
"request_id": "6ebb1a30-76ef-42fe-8ba8-c423791de78e"
}