API Authentication
To authenticate your api requests to the Push API, every request for api data needs to have the following Headers:
email: myemail@something.com
apikey: SOMEAPIKEYYOUHAVE
Triggering Notifications
Using this endpoint in the Push API, you can trigger a notification you've already created on the dashboard to be sent to your users. See below for the options and parameters of the endpoint.
Notification Trigger Endpoint
POST Endpoint: https://push-api.bytebrew.io/api/{push-app-id}/notification/trigger
Body Parameters
See the following for the body parameters to trigger a notification request using the endpoint:
Example Request #1
POST Endpoint: https://push-api.bytebrew.io/api/{push-app-id}/notification/trigger
Body:
{
"notification_name": "24HR Re-Engagement Push",
"test_send": true //Sends to test push notification users only
}
Example Request #2
POST Endpoint: https://push-api.bytebrew.io/api/{push-app-id}/notification/trigger
Body:
{
"notification_name": "Live Event Started Push"
}
Create Custom Notifications
Using this endpoint in the Push API, you can create a custom push notification and send it to your players that are apart of a specific segment you've setup on the Push Notification Segments dashboard.
Custom Notification Endpoint
POST Endpoint: https://push-api.bytebrew.io/api/{push-app-id}/notification/custom
Body Parameters
See the following for the body parameters to request to send a custom notification using the endpoint:
If you want to add localization to your notification using the Push API, you must utilize the following structured parameters under the "extras":
Example Request #1
POST Endpoint: https://push-api.bytebrew.io/api/{push-app-id}/notification/custom
Body:
{
"segment_name": "24HR Lapsed Users",
"title": "Hey What's Up",
"body": "Come back and start a new game"
}
Example Request #2 Additional Languages
POST Endpoint: https://push-api.bytebrew.io/api/{push-app-id}/notification/custom
Body:
{
"segment_name": "24HR Lapsed Users",
"title": "Hey What's Up",
"body": "Come back and start a new game",
"subtitle": "Do you know what time it is",
"extras": [
{
"locale": "fr",
"title": "Hey, qu'est-ce qu'il y a",
"body": "Reviens et commence une nouvelle partie",
"subtitle": "Savez-vous quelle heure il est"
},
{
"locale": "es",
"title": "Hola! Qué tal",
"body": "Vuelve y comienza un nuevo juego.",
"subtitle": "Sabes que hora es"
}
]
}
Send Single Custom Notifications
Using this endpoint in the Push API, you can send a single notification to a specific user(s) individually in your app or game.
Single Send Notification Endpoint
POST Endpoint: https://push-api.bytebrew.io/api/{push-app-id}/notification/send
Body Parameters
See the following for the body parameters to request to send an individual custom notification to a user(s) using the endpoint:
If you want to add localization to your notification using the Push API, you must utilize the following structured parameters under the "extras":
Example Request #1
POST Endpoint: https://push-api.bytebrew.io/api/{push-app-id}/notification/send
Body:
{
"users": [
"USER_1",
"USER_2"
],
"title": "Hey What's Up",
"body": "Come back and start a new game"
}
Example Request #2 Additional Languages
POST Endpoint: https://push-api.bytebrew.io/api/{push-app-id}/notification/send
Body:
{
"users": [
"USER_1",
"USER_2"
],
"title": "Hey What's Up",
"body": "Come back and start a new game",
"subtitle": "Do you know what time it is",
"extras": [
{
"locale": "fr",
"title": "Hey, qu'est-ce qu'il y a",
"body": "Reviens et commence une nouvelle partie",
"subtitle": "Savez-vous quelle heure il est"
},
{
"locale": "es",
"title": "Hola! Qué tal",
"body": "Vuelve y comienza un nuevo juego.",
"subtitle": "Sabes que hora es"
}
]
}