The following document defines the process for utilizing an API for apps to manage push tokens in the Engagement service.
Add Token
Before an app can receive push messages from the Engagement service, a push token must be registered.
Endpoint:
POST:
http://token.api.kochava.com/token/add
Request:
Attributes | Description | Format |
---|---|---|
kochava_device_id | The Kochava Device ID | string |
kochava_app_id | The Kochava App GUID | string |
data | The app data. | object |
token | The push token for the app install. | string |
locale | The device locale collected from the OS. It must be in BCP47, iOS, or Java 6 format. | string |
timezone | The device timezone collected from the OS. This is used by campaigns targeting device local time. It must be a tzid from https://www.iana.org/time-zones. | string |
usertime | Seconds since unix epoc. | number |
Body:
{
"kochava_device_id": "kochavatest-2017-06-16",
"kochava_app_id": "kochavatestapp1348526e9b5bd20a4",
"data": {
"token": "kochavatest0a0b1c9d2e8f347560b1c9d2e8f3475660b1c9d2e8f3475",
"locale": "en-US",
"timezone": "US/Pacific",
"usertime": 1234512345
}
}
Response:
Attributes | Description | Format |
---|---|---|
success | The request was successful. | boolean |
msg | The error message, if any. | string |
Body:
{
"success": true,
"msg": "Error Message, if any"
}
Remove Token
Once a token is removed from the push service, the app will not receive messages from the Engagement service.
Endpoint:
POST:
https://token.api.kochava.com/token/remove
Request:
Attributes | Description | Format |
---|---|---|
kochava_device_id | The Kochava Device ID | string |
kochava_app_id | The Kochava App GUID | string |
data | The app data. | object |
token | The push token for the app install. | string |
usertime | Seconds since unix epoc. | number |
Body:
{
"kochava_device_id": "kochavatest-2017-06-16",
"kochava_app_id": "kochavatestapp1348526e9b5bd20a4",
"data": {
"token": "kocahvatest0a0b1c9d2e8f347560b1c9d2e8f3475660b1c9d2e8f3475",
"usertime": 1234512345
}
}
Response:
Attributes | Description | Format |
---|---|---|
success | The request was successful. | boolean |
msg | The error message, if any. | string |
Body:
{
"success": true,
"msg": "Error Message, if any"
}