Platform API
Application

Application

You can create one SendBird application per app for your chatting service, regardless of the platform. For example, your app released in both Android and iOS systems would require only one SendBird application to be created. You can manage multiple SendBird applications, as well as your apps in general, using the Platform API.

Before you start building your chat, you should understand that a Sendbird application has some restrictions on its abilities to maintain the stability of chat service and also gives you ways to work with the application users. With the following information, you can integrate the SendBird application to your own app for us to work better together.

Resource representation

Property nameTypeDescription

app_id

string

The unique ID of the application.

name

string

The name of the application.

api_token

string

The credential of the application for accessing the Platform APIs. It is an opaque string which should be submitted to SendBird server for application identification when requesting.

icon_url

string

The URL of the application's icon image.


Default settings

To prevent some users' abnormal activities, a SendBird application imposes the following limits on the number of messages per second which a user can send and an open channel can display.

Imposed onLimitIf exceeded

User

5 messages per second

Excess messages from a user are not sent to a channel, and not saved in the database. But in the user's channel view, the messages are displayed.

Open channel

5 messages per second

Excess messages in an open channel are not displayed, but saved in the database. (This setting is not effective in a group channel.)

The limits above are basic numbers of our premium features, spam flood protection and smart throttling, which can be adjusted only by our side. If you want assistance on the settings, contact our engineering team.

Actions

  • API endpoints are relative to the base URL allocated to your application. In this page, the /applications endpoint refers to https://api-{application_id}.sendbird.com/v3/applications.

Note: If you want to know the ID and base URL of your application, sign in to your dashboard, select the application, open the Overview, and then check the App credentials > App ID, API request URL.

  • Requests to the same endpoint can perform different actions based on the type of authentication included in the header.
Actions that require HTTP Basic authentication
ActionHTTP request

List applications

GET /applications
Retrieves a list of all applications. You must use the HTTP Basic authentication.

Create an application

POST /applications
Creates an application. You must use the HTTP Basic authentication.

Delete all applications

DELETE /applications
Deletes all applications. You must use the HTTP Basic authentication.

Actions that require API token authorization
ActionHTTP request

View an application

GET /applications/info
Retrieves information about an application.

Delete an application

DELETE /applications
Deletes an application.

View number of concurrent connections

GET /applications/ccu
Retrieves the number of concurrently connected users.

View number of monthly active users

GET /applications/mau
Retrieves the number of monthly active users.

View number of daily active users

GET /applications/dau
Retrieves the number of daily active users.

View number of daily messages

GET /applications/messages/daily_count
Retrieves the total number of messages sent on a given date.

List push configurations

GET /applications/push/{push_type}
Retrieves a list of push configurations of an application.

Vew a push configuration

GET /applications/push/{push_type}/{provider_id}
Retrieves a specific push configuration of an application. The type of a push configuration is either gcm or apns.

Add a GCM push configuration

POST /applications/push/gcm
Registers a GCM push configuration. To send push notifications to Android devices, you should first register the GCM push configuration.

Update a GCM push configuration

PUT /applications/push/gcm/{provider_id}
Updates a specific GCM push configuration.

Add an APNs push configuration

POST /applications/push/apns
Registers an APNs push configuration. To send push notifications to iOS devices, your should first register the APNs push configuration.

Update an APNs push configuration

PUT /applications/push/apns/{provider_id}
Updates a specific APNs push configuration.

Remove a push configuration

DELETE /applications/push/{push_type}/{provider_id}
Unregisters the push configuration of an application. The type of a push configuration is either gcm or apns.

Delete an APNs certificate

DELETE /applications/push/apns/cert/{provider_id}
Deletes the APNs certificate.

List push message templates

GET /applications/push/message_templates
Retrieves a list of push message templates of an application.

View a push message template

GET /applications/push/message_templates/{template_name}
Retrieves information on a specific push message template of an application.

Update a push message template

POST or PUT /applications/push/message_templates/{template_name}
Updates a specific push message template of an application.

View default channel invitation preference

GET /applications/default_channel_invitation_preference
Retrieves the default channel invitation preference of an application.

Update default channel invitation preference

PUT /applications/default_channel_invitation_preference
Updates the default channel invitation preference of an application.

View an API token

GET /applications/api_tokens/{api_token}
Retrieves information on the API token. You can't view information of other API tokens unless requesting with the Master API token

Revoke an API token

DELETE /applications/api_tokens/{api_token}
Revokes the API token. You can't revoke other API tokens unless requesting with the Master API token.

Actions that require Master API token authorization
ActionHTTP request

List API tokens

GET /applications/api_tokens
Retrieves a list of API tokens issued. Only a request with the Master API token can list up API tokens.

View an API token

GET /applications/api_tokens/{api_token}
Retrieves information of the API token. Only a request with the Master API token can view information on any API token.

Issue an API token

POST /applications/api_tokens
Issues an API token. Only a request with the Master API token can issue a new API token.

Revoke an API token

DELETE /applications/api_tokens/{api_token}
Revokes the API token. Only a request with the Master API token can revoke any API token.


List applications

Retrieves a list of all applications. You must use the HTTP Basic authentication.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications   

Parameters

The following table lists the parameters that this action supports.

Parameters
OptionalTypeDescription

token

string

Specifies a token that indicates the starting index of a chunk of results to retrieve. If not specified, the index is set as 0.

limit

int

Specifies the number of results to return per page. Acceptable values are 1 to 100, inclusive. (Default: 10)

Response

If successful, this action returns a list of application resources in the response body like the following.

Status: 200 OK
Light Color Skin
Copy
{
    "applications": [
        {
            "name": "New SendBird Application",
            "app_id": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "api_token": "5add197438b9bc373af63a0f043daa93820dc474",
            "icon_url": ""
        },
        ... # More applications
    ],
    "next": "qrsYrFRAQ1AIEUYXX1RcE2d0FUZSUlkJFVQRHB86AkAgNn8eABABBBNFX11fUl34DR22"
}
Property nameTypeDescription

applications[]

list

A list of applications resources.

next

string

The value for the token parameter to retrieve the next page in the result set.


Create an application

Creates an application. You must use the HTTP Basic authentication.

HTTP request

Light Color Skin
Copy
POST https://api-{application_id}.sendbird.com/v3/applications

Request body

The following table lists the properties of an HTTP request that this action supports.

Properties
RequiredTypeDescription

name

string

Specifies the name of the application. The length is limited to 128 bytes.

Request body example
Light Color Skin
Copy
{
    "name": "New SendBird Application"
}

Response

If successful, this action returns an application resource in the response body like the following.

Light Color Skin
Copy
{
    "name": "My Application",
    "app_id": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "api_token": "80af23e7ec3a57fa2c92c219faf9e8f1e5bd4a6c",
    "icon_url": ""
}

Delete all applications

Deletes all applications. You must use the HTTP Basic authentication.

HTTP request

Light Color Skin
Copy
DELETE https://api-{application_id}.sendbird.com/v3/applications  

Response

If successful, this action returns an empty response body.


View an application

Retrieves information about an application.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/info  

Response

If successful, this action returns an application resource in the response body.


Delete an application

Deletes an application.

HTTP request

Light Color Skin
Copy
DELETE https://api-{application_id}.sendbird.com/v3/applications  

Response

If successful, this action returns an empty response body.


View number of concurrent connections

Retrieves the number of devices and opened browser tabs which are currently connected to SendBird server.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/ccu   

Response

If successful, this action returns the number of concurrent connections in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "ccu": 327               
}
Property nameTypeDescription

ccu

int

The number of concurrent connections.


View number of monthly active users

Retrieves the number of monthly active users of the application (MAU).

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/mau

Parameters

The following table lists the parameters that this action supports.

Parameters
OptionalTypeDescription

date

string

Specifies the date of reference.

Request example
Light Color Skin
Copy
?date=2018-11-30

Response

If successful, the number of monthly active users during a month behind the specified date is returned in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "mau": 52778
}

View number of daily active users

Retrieves the number of daily active users of the application (DAU).

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/dau

Parameters

The following table lists the parameters that this action supports.

Parameters
OptionalTypeDescription

date

string

Specifies the date of reference.

Request example
Light Color Skin
Copy
?date=2018-12-01

Response

If successful, this action returns the number of daily active users on the specified date in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "dau": 1826
}

View number of daily messages

Retrieves the total number of messages sent on a given day for a range of dates.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/messages/daily_count

Parameters

The following table lists the parameters that this action supports.

Parameters
OptionalTypeDescription

start_date

string

Specifies the starting date to return results of.

end_date

string

Specifies the ending date to return results of.

Request example
Light Color Skin
Copy
?start_date=2018-11-25&end_date=2018-12-01

Response

If successful, this action returns the total number of messages sent on the specified date in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "message_count": {
        "2018-11-25": 156,
        "2018-11-26": 175,
        "2018-11-27": 238,
        "2018-11-28": 188,
        "2018-11-29": 293,
        "2018-11-30": 299,
        "2018-12-01": 283
    }
}
Property nameTypeDescription

message_count

nested object

The number of messages sent within the application on a given date.


List push configurations

Retrieves a list of an application's registered push configurations.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/push/{push_type}

Parameters

The following table lists the parameters that this action supports.

Parameters
RequiredTypeDescription

push_type

string

Specifies the type of the push configuration to retrieve a list. Acceptable values are gcm (for FCM) and apns (for APNs).

Response

If successful, this action returns a list of the registered push configurations in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_configurations": [
        {
            "id": "fbdd6d0071217ac71b5d8acab65d615cfab3f7b1",
            "push_type": "GCM",
            "gcm_api_key": "BBBBEEuCTTE:APA91bE8HPMm-xQa5RT4RaPXi-UdmGNfjDUAaFRryNbth7k4uLZGK9TufYqZXLBf82I3DHyH-L5QlNef1t60WxocozV3uWIRQkESW69XgKyrRQEBH8vKlE9C5rkDtUJDFavEgFmiICvw",
            "gcm_sender_id": "69982227377"
        },
        {
            "id": "065c7f1c0e98b9eac8792e7da9211ce30e3923f1",
            "push_type": "GCM",
            "gcm_api_key": "CCCCEEuCTTE:APA91bE8HPMm-xQa5RT4RaPXi-UdmGNfjDUAaFRryNbth7k4uLZGK9TufYqZXLBf82I3DHyH-L5QlNef1t60WxocozV3uWIRQkESW69XgKyrRQEBH8vKlE9C5rkDtUJDFavEgFmiICvw",
            "gcm_sender_id": "69981117377"
        }
    ]
}
Property nameTypeDescription

push_configurations[]

list

A list of push configurations.


View a push configuration

Retrieves a specific push configuration of an application. The type of a push configuration is either gcm or apns.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/push/{push_type}/{provider_id}

Parameters

The following table lists the parameters that this action supports.

Parameters
RequiredTypeDescription

push_type

string

Specifies the type of the push configuration to retrieve. Acceptable values are gcm (for FCM) and apns (for APNs).

provider_id

string

Specifies the provider ID of the push configuration to retrieve.

Response

If successful, this action returns information on a push configuration in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_configurations": [
        {
            "id": "ee0c11de94007d85045318f4d8b2d19424514291",
            "push_type": "APNS",
            "apns_type": "DEVELOPMENT",
            "apns_expiration": 1550288059,
            "apns_name": "com.sendbird.sample",
            "is_active": 1,
            "has_unread_count_badge": 1
        }
    ]
}
Property nameTypeDescription

push_configurations[]

list

A list of push configurations.


Add a GCM push configuration

Registers a GCM (Google Cloud Messaging or Firebase Cloud Messaging) push configuration for your client app. To send push notifications to Android devices, you should first register the GCM push configuration. You can also register the configurations in your dashboard under Application settings > Notifications.

HTTP request

Light Color Skin
Copy
POST https://api-{application_id}.sendbird.com/v3/applications/push/gcm

Request body

The following table lists the properties of an HTTP request that this action supports.

Properties
RequiredTypeDescription

gcm_sender_id

string

Specifies the GCM Sender ID to register.

gcm_api_key

string

Specifies the GCM API Key to register.

OptionalTypeDescription

push_sound

string

Specifies the name of a sound file to be played when a push notification is delivered to your client app. The file should be located in the /res/raw folder.

Response

If successful, this action returns the information about the registered GCM push configuration in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_configurations": [
        "6646a4d45610dfb0c772f14134610c6ff3121e59"
    ]
}
Property nameTypeDescription

push_configurations[]

list

A list of push configurations.

push_configurations.id

string

A unique provider ID that identifies the push configuration. This is automatically generated by SendBird.


Update a GCM push configuration

Updates a specific GCM (Google Cloud Messaging or Firebase Cloud Messaging) push configuration for your client app. You can also update the configurations in your dashboard under Application settings > Notifications.

HTTP request

Light Color Skin
Copy
PUT https://api-{application_id}.sendbird.com/v3/applications/push/gcm/{provider_id}

Parameters

The following table lists the parameters that this action supports.

Parameters
RequiredTypeDescription

provider_id

string

Specifies the provider ID of the push configuration to update.

Request body

The following table lists the properties of an HTTP request that this action supports.

Properties
OptionalTypeDescription

gcm_sender_id

string

Specifies the GCM Sender ID to update.

gcm_api_key

string

Specifies the GCM API Key to update.

push_sound

string

Specifies the name of a sound file to be played when a push notification is delivered to your client app. The file should be located in the /res/raw folder.

Response

If successful, this action returns the information about the updated GCM push configuration in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_configurations": [
        "6646a4d45610dfb0c772f14134610c6ff3121e59"
    ]
}
Property nameTypeDescription

push_configurations[]

list

A list of push configurations.

push_configurations.id

string

A unique provider ID that identifies the push configuration. This is automatically generated by SendBird.


Add an APNs push configuration

Registers an APNs (Apple Push Notification service) push configuration for your client app. To send push notifications to iOS devices, your should first register the APNs push configuration. You can also register the configurations in your dashboard under Application settings > Notifications.

Note: To upload a .p12 certificate file to SendBird server, you should send a Multipart request .

HTTP request

Light Color Skin
Copy
POST https://api-{application_id}.sendbird.com/v3/applications/push/apns

Request body

The following table lists the properties of an HTTP request that this action supports.

Properties
RequiredTypeDescription

apns_cert

file

In a form of the multipart/form-data content type, specifies a .p12 file of which type is either development or production. SendBird server scans the content of the file, finds out the certificate type, and then registers the file as the corresponding type. If you upload a wrong file, you will receive an error.

OptionalTypeDescription

apns_cert_password

string

Specifies the password of the cerfificate file which has been set during the .p12 export.

has_unread_count_badge

boolean

Determines whether to badge your client app's icon with the number of a user's unread messages. (Default: true)

content_available

boolean

Determines for your client app whether to perform a silent background update on a user's device. For more information, see the Apple Developer Documentation's Pushing Updates to Your App Silently. (Default: false)

mutable_content

boolean

Determines for your client app whether or not to modify the payload of a push notification before it is displayed on a user's device. For more information, see the Apple Developer Documentation's Modifying Content in Newly Delivered Notifications. (Default: false)

push_sound

string

Specifies the name of a sound file to be played when a push notification is delivered to your client app. The file can be in the app's main bundle or in the Library/Sounds folder of the app's data container.

HTTP
Python
curl
Light Color Skin
Copy
Content-Type: multipart/form-data; boundary=--boundary_string
Content-Length: (Length of content)

----boundary_string
Content-Disposition: form-data; name="has_unread_count_badge"

(boolean)
----boundary_string
Content-Disposition: form-data; name="apns_cert"; filename="push_notification_certificate.p12"
Content-Type: application/x-pkcs12

(contents of the certificate)
----boundary_string--
Light Color Skin
Copy
import os
import requests
api_headers = {'Api-Token': '{api_token}'}
data = {
    'has_unread_count_badge': {boolean}
}
filepath = os.path.join(os.path.dirname(__file__), '{file_path}', '{file_name}')
upload_files = {'apns_cert': ('{file_name}', open(filepath, 'rb'))}
res = requests.post('{request_URL}', headers=api_headers, data=data, files=upload_files)
Light Color Skin
Copy
curl -X {HTTP method}
    -H "Api-Token: {api_token}"
    -H "Content-Type: multipart/form-data; boundary=--boundary_string"
    -F "has_unread_count_badge={boolean}"
    -F "apns_cert=@filename"
    "{request_URL}"

Note: If you can't upload your .p12 file to SendBird server using the Platform API or SendBird Dashboard, it might be some buggy behavior caused by the Keychain Access on your Mac.

If you use a single CSR file which you uploaded to the Apple Developer Member Center before, you might receive the same CSR file even when requesting separate files for Development and Production stages.

To solve this problem, you must generate another CSR file and upload it to your Apple Developer Member Center. Then, retry the .p12 file generation steps, and upload the new .p12 file to SendBird server.

Response

If successful, this action returns the information about the registered APNs push configuration in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_configurations": [
        {
            "id": "ee0c11de94007d85045318f4d8b2d19424514291"
        }
    ]
}
Property nameTypeDescription

push_configurations[]

list

A list of push configurations.

push_configurations.id

string

A unique provider ID that identifies the push configuration. This is automatically generated by SendBird.


Update an APNs push configuration

Updates a specific APNs (Apple Push Notification service) push configuration for your client app. You can also register the configurations in your dashboard under Application settings > Notifications.

Note: If your HTTP request body contains a .p12 certificate file to upload to SendBird server, you should send a Multipart request .

HTTP request

Light Color Skin
Copy
PUT https://api-{application_id}.sendbird.com/v3/applications/push/apns/{provider_id}

Parameters

The following table lists the parameters that this action supports.

Parameters
RequiredTypeDescription

provider_id

string

Specifies the provider ID of the push configuration to update.

Request body

The following table lists the properties of an HTTP request that this action supports.

Properties
OptionalTypeDescription

apns_cert

file

In a form of the multipart/form-data content type, specifies a .p12 file of which type is either development or production. SendBird server scans the content of the file, finds out the certificate type, and then registers the file as the corresponding type. If you upload a wrong file, you will receive an error. You should specify either this property or the apns_type below to inform the server of which certificate type to update.

apns_type

string

Specifies the password of the cerfificate file which has been set during the .p12 export. You should specify either this property or the apns_cert above to inform the server of which certificate type to update.

apns_cert_password

string

Specifies the password of the cerfificate file which has been set during the .p12 export.

has_unread_count_badge

boolean

Determines whether to badge your client app's icon with the number of a user's unread messages. (Default: true)

content_available

boolean

Determines for your client app whether to perform a silent background update on a user's device. For more information, see the Apple Developer Documentation's Pushing Updates to Your App Silently. (Default: false)

mutable_content

boolean

Determines for your client app whether or not to modify the payload of a push notification before it is displayed on a user's device. For more information, see the Apple Developer Documentation's Modifying Content in Newly Delivered Notifications. (Default: false)

push_sound

string

Specifies the name of a sound file to be played when a push notification is delivered to your client app. The file can be in the app's main bundle or in the Library/Sounds folder of the app's data container.

HTTP
Python
curl
Light Color Skin
Copy
Content-Type: multipart/form-data; boundary=--boundary_string
Content-Length: (Length of content)

----boundary_string
Content-Disposition: form-data; name="has_unread_count_badge"

(boolean)
----boundary_string
Content-Disposition: form-data; name="apns_cert"; filename="push_notification_certificate.p12"
Content-Type: application/x-pkcs12

(contents of the certificate)
----boundary_string--
Light Color Skin
Copy
import os
import requests
api_headers = {'Api-Token': '{api_token}'}
data = {
    'has_unread_count_badge': {boolean}
}
filepath = os.path.join(os.path.dirname(__file__), '{file_path}', '{file_name}')
upload_files = {'apns_cert': ('{file_name}', open(filepath, 'rb'))}
res = requests.post('{request_URL}', headers=api_headers, data=data, files=upload_files)
Light Color Skin
Copy
curl -X {HTTP method}
    -H "Api-Token: {api_token}"
    -H "Content-Type: multipart/form-data; boundary=--boundary_string"
    -F "has_unread_count_badge={boolean}"
    -F "apns_cert=@filename"
    "{request_URL}"

Note: If you can't upload your .p12 file to SendBird server using the Platform API or SendBird Dashboard, it might be some buggy behavior caused by the Keychain Access on your Mac.

If you use a single CSR file which you uploaded to the Apple Developer Member Center before, you might receive the same CSR file even when requesting separate files for Development and Production stages.

To solve this problem, you must generate another CSR file and upload it to your Apple Developer Member Center. Then, retry the .p12 file generation steps, and upload the new .p12 file to SendBird server.

Response

If successful, this action returns the information about the updated APNs push configuration in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_configurations": [
        {
            "id": "ee0c11de94007d85045318f4d8b2d19424514291"
        }
    ]
}
Property nameTypeDescription

push_configurations[]

list

A list of push configurations.

push_configurations.id

string

A unique provider ID that identifies the push configuration. This is automatically generated by SendBird.


Remove a push configuration

Unregisters a specific push configuration of an application. The type of a push configuration is either gcm or apns.

HTTP request

Light Color Skin
Copy
DELETE https://api-{application_id}.sendbird.com/v3/applications/push/{push_type}/{provider_id}

Parameters

The following table lists the parameters that this action supports.

Parameters
RequiredTypeDescription

push_type

string

Specifies the type of the push configuration to unregister. Acceptable values are gcm (for FCM) and apns (for APNs).

provider_id

string

Specifies the provider ID of the push configuration to unregister.

Response

If successful, this action returns the provider ID of an unregistered push configuration in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_configurations": [
        "7757a4d45610dfb0c772f14134610c6ff3121e59"
    ]
}

Delete an APNs certificate

Deletes a specific APNs certficate.

HTTP request

Light Color Skin
Copy
DELETE https://api-{application_id}.sendbird.com/v3/applications/push/apns/cert/{provider_id}

Parameters

The following table lists the parameters that this action supports.

Parameters
RequiredTypeDescription

provider_id

string

Specifies the provider ID of the APNs certificate to delete.

Response

If successful, this action returns the provider ID of a deleted certificate in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_configurations": [
        "r0dc11de94007a8b045318f4d8b2d19328538745"
    ]
}

List push message templates

Retrieves a list of push message templates of an application.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/push/message_templates

Response

If successful, this action returns a list of push message templates in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_message_templates": [
        {
            "template_name": "default",
            "template": {   // for each message type
                "MESG": "{sender_name}: {message}", 
                "FILE": "{filename}",
                "ADMM": "{message}"
            }
        },
        {
            "template_name": "alternative",
            "template": {   // for each message type
                "MESG": "New message arrived!",
                "FILE": "New file delivered!",
                "ADMM": "New announcement!"
            }
        }
    ]
}
Property nameTypeDescription

push_message_templates[]

list

A list of push message templates.


View a push message template

Retrieves information on a specific push message templates of an application. The name of a push message template is either default or alternative.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/push/message_templates/{template_name}

Parameters

The following table lists the parameters that this action supports.

Parameters
RequiredTypeDescription

template_name

string

Specifies the name of a push message template to retrieve. Acceptable values are default and alternative.

Response

If successful, this action returns information on a push message template in the response body.


Update a push message template

Updates a specific push message template of an application. The name of a push message template is either default or alternative.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/push/message_templates/{template_name}

Parameters

The following table lists the parameters that this action supports.

Parameters
RequiredTypeDescription

template_name

string

Specifies the name of a push message template to update. Acceptable values are default and alternative.

Request body

The following table lists the properties of an HTTP request that this action supports.

Properties
RequiredTypeDescription

template

nested object

The push message template of which message types to be updated and their detailed format.

template.MESG

string

Specifies a format for text messages. We support customization of two fields, which are the sender_name and message. These fields will be replaced with actual corresponding values when sending notification requests to FCM or APNs.

template.FILE

string

Specifies a format for file messages. We support customization of one field, which is the filename. This field will be replaced with actual corresponding values when sending notification requests to FCM or APNs.

template.ADMN

string

Specifies a format for admin messages. We support customization of one field, which is the message. This field will be replaced with actual corresponding values when sending notification requests to FCM or APNs.

Request body example
Light Color Skin
Copy
{
    "template": {
        "MESG": "{sender_name}: {message}",
        "FILE": "{filename} is arrived!",
        "ADMM": "New announcement: {message}"
    }
}

Response

If successful, this action returns information on a updated push message template in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "push_message_templates": [
        {
            "template_name": "default",
            "template": {
                "MESG": "{sender_name}: {message}",
                "FILE": "{filename} is arrived!",
                "ADMM": "New announcement: {message}"
            },
            "push_message_preview": {   // This shows how a push message is diplayed on a client's device. 
                "MESG": "John: Hi! this is John",
                "FILE": "IMG0001.jpg is arrived!",
                "ADMM": "New announcement: Hi! this is John"
            }
        }
    ]
}

View default channel invitation preference

Retrieves the default channel invitation preference of an application.

Note: Using the view channel invitation preference action, you can retrieve the value of a specific user's channel invitation preference, which can be set individually by user.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/default_channel_invitation_preference

Response

If successful, this action returns the value of the default channel invitation preference of an application in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "auto_accept": true
}
Property nameTypeDescription

auto_accept

boolean

Indicates for users within an application whether or not to automatically join a private group channel promptly from an invitation without having to accept it. (Default: true)


Update default channel invitation preference

Updates the default channel invitation preference of an application.

Note: Using the update channel invitation preference action, you can update the value of a specific user's channel invitation preference, which can be set individually by user.

HTTP request

Light Color Skin
Copy
PUT https://api-{application_id}.sendbird.com/v3/applications/dafault_channel_invitation_preference

Request body

The following table lists the properties of an HTTP request that this action supports.

Properties
RequiredTypeDescription

auto_accept

boolean

Determines for users within an application whether or not to automatically join a private group channel promptly from an invitation without having to accept it. (Default: true)

Response

If successful, this action returns the value of the default channel invitation preference of an application in the response body.


List API tokens

Returns a list of API tokens issued.

Note: Only a request with the Master API token can list up API tokens.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/api_tokens/

Response

If successful, this action returns a list of the issued API tokens in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "api_tokens": [
        {
            "token": "0123456789abcdef01234567890abcdef0123456",
            "created_at": 1500000001234
        },
        {
            "token": "abcdef0123456789abcdef01234567890abcdef0",
            "created_at": 1500000000000
        }
    ]
}

View an API token

Retrieves the information on an API token.

Note: You can't view information of other API token unless requesting with the Master API token.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/api_tokens/{api_token}

Response

If successful, this action returns the information about the specified token in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "token": "0123456789abcdef01234567890abcdef0123456",
    "created_at": 1500000000000
}

Issue an API token

Issues an API token.

Note: Only a request with the Master API token can issue a new API token.

Managing multiple API tokens with the Master API token

You have access to most of the Platform APIs with an API token, except the ability to manage the tokens including issuing or revoking. Such ability is only for the Master API token. The Master API token has access to all the abilities of API tokens, plus issuing a new API token and managing multiple API tokens. The maximum number of API tokens you can manage is 10, which means you can have up to 11 API tokens total, including the Master API token.

Note: It is recommended that you only use API tokens for API calls from your server side. This is because using the Master API token together might lead your API calls to work improperly by accidentally revoking the existing API tokens.

HTTP request

Light Color Skin
Copy
POST https://api-{application_id}.sendbird.com/v3/applications/api_tokens

Request body

The following table lists the properties of an HTTP request that this action supports.

Properties
RequiredTypeDescription

HTTP_API_TOKEN

string

Specifies the Master API token of the application.

Request body example
Light Color Skin
Copy
{
    "HTTP_API_TOKEN": "{master_api_token}"
}

Response

If successful, this action returns the information about the issued token in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "token": "0123456789abcdef01234567890abcdef0123456",
    "created_at": 1500000000000
}

Revoke an API token

Revokes an API token.

Note: You can't revoke other API tokens unless requesting with the Master API token.

HTTP request

Light Color Skin
Copy
DELETE https://api-{application_id}.sendbird.com/v3/applications/api_tokens/{api_token}

Response

If successful, this action returns an empty response body.