Chat / Platform API
Current version: v3
    Chat Platform API v3
    Chat Platform API
    Chat
    Platform API
    Home
    /
    Chat
    /
    Platform API

    List registration or device tokens

    Retrieves a list of a user's registration or device token. You can pass gcm, huawei, or apns for FCM registration token, HMS device token, or APNs device token, respectively, in the token_type parameter for the push notification service you are using.


    HTTP request

    GET https://api-{application_id}.sendbird.com/v3/users/{user_id}/push/{token_type}
    

    Parameters

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    user_id

    string

    Specifies the unique ID of a user.

    token_type

    string

    Specifies the type of the token. Acceptable values are gcm, huawei, and apns for FCM, HMS, and APNS respectively.


    Response

    If successful, this action returns a list of the registered tokens and a user resource in the response body.

    {
        "tokens": [
            "fP7c4oBk_hU:APA91bEzrb3ks301HRvtXxZEdubB_sEhpPFAb0i3cycvd3E9UvFO7ia2uwu2ms7gR-Ra8AmaRNluCT_0frTWBv45jzPvEwEPeNKaNc0iiHnokHAHo0RTzcXcWvrLXmO1Awft_2k7tfi2",
            "dK64CBNk_pH:BKvxZP394bEzrb3ks20LRvtXxZEb_RZhU245NpAbZ3cycvd4E43Uv73eia2Rwu2mf-aZPnAK6R3Nlu_TR36z5RNLzAfWKaTnoK0RKcXvLxKm35dc0iokHAHo0zcWvrELmOAf_5er47t6"
        ],
        "type": "GCM",
        "user": {
            "user_id": "Chris",
            "nickname": "Christopher",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_46_512px.png",
            "metadata": {
                "location": "Seattle",
                "marriage": "Y"
            }
        },
        "token": [
            ... # This key has been deprecated and only exists for backward compatibility.
        ]
    }
    

    List of response properties

    Property nameTypeDescription

    tokens[]

    array of strings

    Specifies an array of registration or device tokens of the user.

    type

    string

    The type of registration or device token. Valid values are: GCM, HUAWEI, or APNS for FCM, HMS, and APNS respectively.

    user

    nested object

    The user resource which encapsulates information about the specified user.

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