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

    Get metacounter

    Copy link

    This action retrieves one or more items of a channel metacounter that are stored 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
    // Retrieve all items of a channel metacounter
    GET https://api-{application_id}.sendbird.com/v3/{channel_type}/{channel_url}/metacounter
    
    // Retrieve a specific item of a channel metacounter by its key
    GET https://api-{application_id}.sendbird.com/v3/{channel_type}/{channel_url}/metacounter/{key}
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Parameters
    RequiredTypeDescription

    channel_type

    string

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

    channel_url

    string

    Specifies the URL of a channel.

    OptionalTypeDescription

    key

    string

    Specifies the key of a metacounter item. If not specified, all items of the metacounter are returned. If specified, only the item that matches the parameter value is returned. URL encoding a key is recommended.

    keys

    array of strings

    In a query string, specifies an array of one or more metacounter keys. If not specified, all items of the metacounter are returned. If specified, only the items that match the parameter values are returned. URL encoding each key is recommended (for example, ?keys=urlencoded_key_1, urlencoded_key_2).

    ../metacounter?keys=likes,dislikes
    

    Responses

    Copy link

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

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

    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
    }