Token API

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:

AttributesDescriptionFormat
kochava_device_idThe Kochava Device IDstring
kochava_app_idThe Kochava App GUIDstring
dataThe 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:

AttributesDescriptionFormat
successThe request was successful.boolean
msgThe 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:

AttributesDescriptionFormat
kochava_device_idThe Kochava Device IDstring
kochava_app_idThe Kochava App GUIDstring
dataThe 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:

AttributesDescriptionFormat
successThe request was successful.boolean
msgThe error message, if any.string

 

Body:

{
  "success": true,
  "msg": "Error Message, if any"
}

 
 

Last Modified: Oct 11, 2023 at 7:50 am