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

    Create metacounter

    Copy link

    This action creates one or more items of a metacounter to store in a channel. Metacounter is additional information about a channel that is a collection of of key-value pairs where the value is always an integer.

    Note: See the channel overview page to learn more about differences among data properties.


    HTTP request

    Copy link
    POST https://api-{application_id}.sendbird.com/v3/{channel_type}/{channel_url}/metacounter
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    channel_type

    string

    Specifies the type of the channel. Acceptable values are open_channels and group_channels.

    channel_url

    string

    Specifies the URL of the channel.


    Request body

    Copy link

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

    Required
    Property nameTypeDescription

    metacounter

    object

    Specifies a JSON object that stores key-value items. The key must not have a comma (,) and its length is limited to 128 characters. The value must be an integer.

    {
        "metacounter": {
            "likes": 0,
            "dislikes": 0,
            "giveups": 0
        }
    }
    

    Response

    Copy link

    If successful, this action returns a stored metacounter in the response body.

    {
        "likes": 0,
        "dislikes": 0,
        "giveups": 0
    }
    

    In the case of an error, an error object like below is returned. See the error codes section for more details.

    {
        "message": "\"Channel\" not found.",
        "code": 400105,
        "error": true
    }