/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    Update a push notification content template

    Copy link

    Updates information on the specified push notification content template of an application. The two types of content templates can be retrieved by specifying either default or alternative in the endpoint.


    HTTP request

    Copy link
    PUT https://api-{application_id}.sendbird.com/v3/applications/push/message_templates/{template_name}
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    template_name

    string

    Specifies the name of a template used for push notifications. Acceptable values are default and alternative.


    Request body

    Copy link

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

    Required
    Property nameTypeDescription

    template

    nested object

    Specifies the types of push notification content templates. A content template contains formats for text messages, file messages, and admin messages.

    template.MESG

    string

    Specifies a format for text messages. The two fields of the format are sender_name and message. Updated values for these fields are sent in notification requests to FCM, HMS, or APNs.

    template.FILE

    string

    Specifies a format for file messages. The two variables for the format are filename and file_type_friendly. Acceptable values for file_type_friendly are Audio, Image, and Video which indicate the type of the file. Updated values for these variables will be sent in notification requests to FCM, HMS, or APNs.

    template.ADMM

    string

    Specifies a format for admin messages. The field of the format is message. An updated value for the field is sent in notification requests to FCM, HMS, or APNs.

    {
        "template": {
            "MESG": "{sender_name}: {message}",
            "FILE": "{filename} is arrived!",
            "ADMM": "New announcement: {message}"
        }
    }
    

    Response

    Copy link

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

    {
        "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 notification is displayed on a client's device.
                    "MESG": "John: Hi! this is John",
                    "FILE": "IMG0001.jpg is arrived!",
                    "ADMM": "New announcement: Hi! this is John"
                }
            }
        ]
    }
    

    In the case of an error, an error object is returned. A detailed list of error codes is available here.