Page tree
Skip to end of metadata
Go to start of metadata

Description

Adds a push subscription to all profiles in a database.

If "id" property is not specified - subscription will be added to all resource's associated databases.

Request URL

Method: POST

https://example.com/api/v1.1/resources/push_subscribe

Request example

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
idint34NoDatabase ID
resource_tokenstring"abcdefghijklmnqrstuvwxyz"YesUnique resource token
subscribtionsJSON array
{
    "provider": "android-firebase",
    "subscription_id": "%subscriptionid%"
}
Yes

Push subscriptions.

"provider" - push subscription provider.
"subscription_id" - is unique for each device. Acquired from Firebase.

Request example

{
    "token": "abcdefghijklmnqrstuvwxyz",
    "id": "59db33d269d426509e9c4bf9",
    "resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
    "subscriptions": [
        {
            "provider": "android-firebase", 
            "subscription_id": "%subscriptionid%" 
        }
    ] 
}

Response example

{
    "error": 0,
    "error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
  • No labels