• APIリファレンス

Server To Server Event

Send In-App/In-Web events in a server to server method.


アプリ内イベントを送信する

POST

https://api.airbridge.io/events/v1/apps/{app_name}/mobile-app/9360

Server To Server方式でアプリ内イベントを送信することができます。

送信方法

1. Device ID(device.deviceUUID)を基準とするイベント送信

SDKのDevice IDを基準にしたアトリビューションが必要な場合に使用します。[データフェッチガイド]

2. User ID(user.externalUserID)を基準とするイベント送信

User IDを基準にしたアトリビューションが必要な場合に使用します。AirbridgeはIDテーブルのuser.externalUserIDに紐付いているデバイスを基準にアトリビューションを計測します。User IDで紐づける場合はDevice IDは渡す必要がなく、User IDとマッチするデバイスがない場合、当該イベントの処理は行われません。

Request

Headers

Accept-Language
string

You can specify the language to use for API requests and responses. It follows the ISO-639-1 format.

Content-Type
string

Represents the media type of the resource. Defaults to application/json.

Authorization
string

The key value to use for API requests. Instructions for getting API keys are in "how to generate API Keys".

X-Forwarded-For
必須string

You can send the user's IP in the X-Forwarded-For header. Without X-Forwarded-For, user behavior is logged with the IP of the server that requested the Server To Server API, not the user's IP (client request IP).

We accept values in the form of ipv4 (123.123.123.123), ipv6 (2001:e60:87e3:81d4:cd57:5d52:ee2e:ff8d).

Path Params

app_name
必須string

Airbridge App Name. (Unique ID)

Body Params

eventUUID
string

Random UUID v4 string.

Accepts a random string in UUID4 format.

The event uuid is used for duplication as a unique ID for the event, and will be generated automatically by the event api if not provided.

eventTimestamp
number

The time the event occurred. (default: current timestamp)

A Unix timestamp in milliseconds (13 digits in Unixtime).

If the eventTimestamp is older than 24 hours from the time the event was sent, it will not be processed by the server.

user
object

User information.

device
条件付き必須object

デバイス情報が含まれます。

*required if user.ExternalUserID is not sent

app
必須object

イベント情報を含められるオブジェクトです。カテゴリー、アクション、ラベル、バリュー、セマンティックアトリビュート(Semantic Attributes)を含めることができます。

eventData
必須object

Event information.

Request
curl -X POST 'https://api.airbridge.io/events/v1/apps/{app_name}/mobile-app/9360' \ -H 'Accept-Language: ko' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer {AIRBRIDGE-API-TOKEN}' \ -H 'X-Forwarded-For: 2001:e60:87e3:81d4:cd57:5d52:ee2e:ff8d' \ -d '{"eventUUID":"9b4b3e4e-2162-4ae6-8986-91ee84644262","user":{"externalUserID":"19443","externalUserEmail":"example@ab180.co","externalUserPhone":"821012341234"},"device":{"deviceUUID":"2dfca632-86f3-4d22-9746-cdfe7985c471","gaid":"2dfca632-86f3-4d22-9746-cdfe7985c471","ifa":"542177F1-5C23-438B-8088-82D34C94F6D7","appSetID":"7c4681ef-97c6-4ebd-9c04-e22f584b3746","ifv":"37EEC3E0-BF15-412E-ADBA-7D2E82E7A75F","limitAdTracking":true,"deviceModel":"LG-H542","appTrackingTransparency":0,"deviceIdentifier":"iPhone11,2","manufacturer":"Samsung","osName":"Android","osVersion":"5.0.2","locale":"ko-KR","timezone":"Asia/Seoul","orientation":"portrait","screen":{"width":123}},"app":{"packageName":"com.ab180.co","version":"1.2.3"},"eventData":{"goal":{"category":"airbridge.ecommerce.product.addedToCart","value":159990,"semanticAttributes":{"currency":"KRW","action":"shoes","label":"nike","transactionID":"12939172","inAppPurchased":true,"products":[{"currency":"KRW","productID":"30372425","price":10990,"name":"나이키 커스텀","position":"1","quantity":1}]}}}}'
Payload
{ "eventUUID": "9b4b3e4e-2162-4ae6-8986-91ee84644262", "user": { "externalUserID": "19443", "externalUserEmail": "example@ab180.co", "externalUserPhone": "821012341234" }, "device": { "deviceUUID": "2dfca632-86f3-4d22-9746-cdfe7985c471", "gaid": "2dfca632-86f3-4d22-9746-cdfe7985c471", "ifa": "542177F1-5C23-438B-8088-82D34C94F6D7", "appSetID": "7c4681ef-97c6-4ebd-9c04-e22f584b3746", "ifv": "37EEC3E0-BF15-412E-ADBA-7D2E82E7A75F", "limitAdTracking": true, "deviceModel": "LG-H542", "appTrackingTransparency": 0, "deviceIdentifier": "iPhone11,2", "manufacturer": "Samsung", "osName": "Android", "osVersion": "5.0.2", "locale": "ko-KR", "timezone": "Asia/Seoul", "orientation": "portrait", "screen": { "width": 123 } }, "app": { "packageName": "com.ab180.co", "version": "1.2.3" }, "eventData": { "goal": { "category": "airbridge.ecommerce.product.addedToCart", "value": 159990, "semanticAttributes": { "currency": "KRW", "action": "shoes", "label": "nike", "transactionID": "12939172", "inAppPurchased": true, "products": [ { "currency": "KRW", "productID": "30372425", "price": 10990, "name": "나이키 커스텀", "position": "1", "quantity": 1 } ] } } }}

Response

200SUCCESS

400ERROR

Invalid requests (timestamp, sdk signature, app name, etc.).

401ERROR

When using an invalid authentication token.

Response
{ "at": "2020-02-06 16:06:49", "data": "Event(9360) is successfully proccessed."}
Response
{ "at": "2020-02-06 16:06:49", "error": "invalid_request", "ingested": 0}
Response
{ "at": "2020-02-06 16:06:49", "error": "unauthorized", "ingested": 0}

Send In-web Events

POST

https://api.airbridge.io/events/v1/apps/{app_name}/web/9320

Send In-Web events in a server-to-server method.

rate limit : 1000 requests per minute.

User Identifiers

Attention

It is recommended to send all available user identifiers as they are crucial for accurate attribution, postback, cohort analysis etc.

Cookie IDs can be retrieved through the SDK(refer to the data fetching guide).
The following attribution data must be sent along with the Cookie ID for proper attribution.

2. User ID(user.externalUserID)

User IDs may be sent without Cookie IDs if data fetching is inconvenient.
In such cases, Airbridge processes events based on the Cookie IDs mapped to the provided User ID.
However, if no mapping is found, this may lower the accuracy of reports.

Request

Headers

Accept-Language
string

You can specify the language to use for API requests and responses. It follows the ISO-639-1 format.

Content-Type
string

Represents the media type of the resource. Defaults to application/json.

Authorization
string

The key value to use for API requests. Instructions for getting API keys are in "how to generate API Keys".

X-Forwarded-For
必須string

You can send the user's IP in the X-Forwarded-For header. Without X-Forwarded-For, user behavior is logged with the IP of the server that requested the Server To Server API, not the user's IP (client request IP).

We accept values in the form of ipv4 (123.123.123.123), ipv6 (2001:e60:87e3:81d4:cd57:5d52:ee2e:ff8d).

Path Params

app_name
必須string

Airbridge App Name. (Unique ID)

Body Params

eventUUID
string

Random UUID v4 string.

Accepts a random string in UUID4 format.

The event uuid is used for duplication as a unique ID for the event, and will be generated automatically by the event api if not provided.

eventTimestamp
number

The time the event occurred. (default: current timestamp)

A Unix timestamp in milliseconds (13 digits in Unixtime).

If the eventTimestamp is older than 24 hours from the time the event was sent, it will not be processed by the server.

user
object

User information.

browser
object

Browser Information.

eventData
必須object

Event information.

Request
curl -X POST 'https://api.airbridge.io/events/v1/apps/{app_name}/web/9320' \ -H 'Accept-Language: ko' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer {AIRBRIDGE-API-TOKEN}' \ -H 'X-Forwarded-For: 2001:e60:87e3:81d4:cd57:5d52:ee2e:ff8d' \ -d '{"eventUUID":"9b4b3e4e-2162-4ae6-8986-91ee84644262","user":{"externalUserID":"19443","externalUserEmail":"example@ab180.co","externalUserPhone":"821012341234"},"browser":{"clientID":"05609013-bb5a-4594-bbc3-832cb1b87072","userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E302"},"eventData":{"shortID":"aef04","trackingData":{"channel":"blog"},"goal":{"category":"airbridge.ecommerce.product.addedToCart","value":159990,"semanticAttributes":{"action":"shoes","label":"nike","query":"나이키","transactionID":"12939172","inAppPurchased":true,"currency":"KRW","products":[{"position":"1","productID":"30372425","name":"나이키 커스텀","price":10990,"quantity":1,"currency":"KRW"}]}}}}'
Payload
{ "eventUUID": "9b4b3e4e-2162-4ae6-8986-91ee84644262", "user": { "externalUserID": "19443", "externalUserEmail": "example@ab180.co", "externalUserPhone": "821012341234" }, "browser": { "clientID": "05609013-bb5a-4594-bbc3-832cb1b87072", "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E302" }, "eventData": { "shortID": "aef04", "trackingData": { "channel": "blog" }, "goal": { "category": "airbridge.ecommerce.product.addedToCart", "value": 159990, "semanticAttributes": { "action": "shoes", "label": "nike", "query": "나이키", "transactionID": "12939172", "inAppPurchased": true, "currency": "KRW", "products": [ { "position": "1", "productID": "30372425", "name": "나이키 커스텀", "price": 10990, "quantity": 1, "currency": "KRW" } ] } } }}

Response

200SUCCESS

400ERROR

Invalid requests (timestamp, sdk signature, app name, etc.).

401ERROR

When using an invalid authentication token.

Response
{ "at": "2020-02-06 16:06:49", "data": "Event(9320) is successfully proccessed."}
Response
{ "at": "2020-02-06 16:06:49", "error": "invalid_request", "ingested": 0}
Response
{ "at": "2020-02-06 16:06:49", "error": "unauthorized", "ingested": 0}