Push API

Push API enables you to utilize push notification functions to send custom notifications or trigger built notifications remotely. The Push API can be accessed by utilizing your Studios API key. Find your Studio API Key to access these functions on the ByteBrew dashboard under your Studio Settings.

API Authentication

tag

To authenticate your api requests to the Push API, every request for api data needs to have the following Headers:

fiber_manual_record
email
fiber_manual_record
apikey
                                
                                
                                email: myemail@something.com
                                apikey: SOMEAPIKEYYOUHAVE
                                
                                
                            

Triggering Notifications

tag

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:

fiber_manual_record
(Required) notification_name: Name of the notification on the Notifications dashboard.
fiber_manual_record
test_send: Boolean indicating to send the notification to only test users you've set up in the Push Notifications Users dashboard.

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

tag

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:

fiber_manual_record
(Required) segment_name: The name of the Segment that you've setup on the Segments page of the Push Notifcations dashboard.
fiber_manual_record
(Required) title: The title of the push notification you want shown in the notification.
fiber_manual_record
(Required) body: The body text of the push notification you want shown in the notification.
fiber_manual_record
subtitle: Optional Subtitle of the push notification you can add to the notification. iOS Only
fiber_manual_record
test_send: Boolean indicating to send the notification to only test users you've set up in the Push Notifications Users dashboard.
fiber_manual_record
extras: Optional Array of extra notification langauge settings you want to send in other localized languages.

If you want to add localization to your notification using the Push API, you must utilize the following structured parameters under the "extras":

fiber_manual_record
locale: Two letter language code that defines the localized langauge.
fiber_manual_record
title: The title of the push notification you want shown in the notification.
fiber_manual_record
body: The body text of the push notification you want to send.
fiber_manual_record
subtitle: Optional Subtitle of the push notification you can add to the notification. iOS Only

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

tag

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:

fiber_manual_record
(Required) users: Array of user ID's that you want the notification to be sent to.
fiber_manual_record
(Required) title: The title of the push notification you want shown in the notification.
fiber_manual_record
(Required) body: The body text of the push notification you want shown in the notification.
fiber_manual_record
subtitle: Optional Subtitle of the push notification you can add to the notification. iOS Only
fiber_manual_record
extras: Optional Array of extra notification langauge settings you want to send in other localized languages.

If you want to add localization to your notification using the Push API, you must utilize the following structured parameters under the "extras":

fiber_manual_record
locale: Two letter language code that defines the localized langauge.
fiber_manual_record
title: The title of the push notification you want shown in the notification.
fiber_manual_record
body: The body text of the push notification you want to send.
fiber_manual_record
subtitle: Optional Subtitle of the push notification you can add to the notification. iOS Only

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"
                                            }
                                        ]
                                    }
                                
                                
                            

Need some help?

Join the ByteBrew Discord community to chat with our team and other developers on the platform.