Skip to main content

Get profile subscription

Description

Retrieves detailed information about one profile subscription.

Request URL

Method: POST

https://example.com/api/v1.1/subscriptions/get

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
db_idint1YesDatabase ID
formatstring"json"
Response data format.
By default – json.
profile_idstring"abcdefghijklmnqrstuvwxyz"YesProfile ID
resource_idint1YesResource ID

Additionally for the Email channel:

ParameterTypeExampleDescription
channelstring"email"Channel type
emailstring"john@example.com"Email address

Additionally for the Push channel:

ParametersTypeExampleDescription
channelstring"push"Channel type
providerstring"Firefox"Provider type
subscription_idstring"abcdefghijklmnqrstuvwxyz"Subscription ID

Additionally for the SMS channel:

ParametersTypeExampleDescription
channelstring"sms"Channel type
phonestring"+79000000000"Phone number

Additionally for the Telegram channel:

ParametersTypeExampleDescription
channelstring"telegram_bot"Channel type
cc_dataobject
{
"id": 1
}
Chat ID between Telegram bot and user

Additionally for the WhatsApp channel:

ParametersTypeExampleDescription
channelstring"telegram_bot"Channel type
cc_dataobject
{
"phone": "+79000000000"
}
WhatsApp user's phone number

Request example

{
"channel": "push",
"db_id": 1,
"profile_id": "abcdefghijklmnqrstuvwxyz",
"provider": "Firefox",
"resource_id": 1,
"subscription_id": "abcdefghijklmnqrstuvwxyz",
"token": "abcdefghijklmnqrstuvwxyz"
}

Response example

{
"data": {
"channel": "push",
"priority": 10,
"provider": "Firefox",
"resource_id": 1,
"status": "subscribed",
"subscription_id": "abcdefghijklmnqrstuvwxyz",
"custom_fields": {
"_device_type": "mob",
"_os": "Android",
"custom_field_1": "test value"
},
"cats": [
"news_category",
"transaction_category"
]
},
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
channelstringChannel type (email, push or sms)
priorityintSubscription priority ( 0 is the highest priority)
resource_idintSubscription resource ID
statusstringSubscription status
custom_fieldsobjectSystem and custom subscription fields.

You can get information about subscription fields in a resource using the /v1.1/resources/fields_get method
catsarrayThe resource categories to which the profile is subscribed.

Additionally for the Email channel:

ParameterTypeDescription
emailstringEmail address

Additionally for the Push channel:

ParameterTypeDescription
providerstringProvider type
subscription_idstringSubscription ID

Additionally for the SMS channel:

ParameterTypeDescription
phonestringPhone number

Additionally for the Telegram channel:

ParameterTypeDescription
cc_dataobjectChat ID between Telegram bot and user

Additionally for the WhatsApp channel:

ParameterTypeDescription
cc_dataobjectWhatsApp user's phone number