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
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
db_id | int | 1 | Yes | Database ID |
format | string | "json" | Response data format. By default – json. | |
profile_id | string | "abcdefghijklmnqrstuvwxyz" | Yes | Profile ID |
resource_id | int | 1 | Yes | Resource ID |
Additionally for the Email channel:
Parameter | Type | Example | Description |
---|---|---|---|
channel | string | "email" | Channel type |
string | "john@example.com" | Email address |
Additionally for the Push channel:
Parameters | Type | Example | Description |
---|---|---|---|
channel | string | "push" | Channel type |
provider | string | "Firefox" | Provider type |
subscription_id | string | "abcdefghijklmnqrstuvwxyz" | Subscription ID |
Additionally for the SMS channel:
Parameters | Type | Example | Description |
---|---|---|---|
channel | string | "sms" | Channel type |
phone | string | "+79000000000" | Phone number |
Additionally for the Telegram channel:
Parameters | Type | Example | Description |
---|---|---|---|
channel | string | "telegram_bot" | Channel type |
cc_data | object | { | Chat ID between Telegram bot and user |
Additionally for the WhatsApp* channel:
Parameters | Type | Example | Description |
---|---|---|---|
channel | string | "telegram_bot" | Channel type |
cc_data | object | { | WhatsApp* user's phone number |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"db_id": 1,
"resource_id": 26,
"channel": "push",
"subscription_id": "abcdefghijklmnqrstuvwxyz",
"profile_id": "abcdefghijklmnqrstuvwxyz",
"provider": "Firefox"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<db_id>1</db_id>
<resource_id>26</resource_id>
<channel>push</channel>
<subscription_id>abcdefghijklmnqrstuvwxyz</subscription_id>
<profile_id>abcdefghijklmnqrstuvwxyz</profile_id>
<provider>Firefox</provider>
</xml>
Response example
- JSON
- XML
{
"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"
}
<xml>
<data>
<channel>push</channel>
<priority>0</priority>
<provider>Firefox</provider>
<resource_id>26</resource_id>
<status>subscribed</status>
<subscription_id>abcdefghijklmnqrstuvwxyz</subscription_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
channel | string | Channel type (email, push or sms) |
priority | int | Subscription priority ( 0 is the highest priority) |
resource_id | int | Subscription resource ID |
status | string | Subscription status |
custom_fields | object | System and custom subscription fields. You can get information about subscription fields in a resource using the /v1.1/resources/fields_get method |
cats | array | The resource categories to which the profile is subscribed. |
Additionally for the Email channel:
Parameter | Type | Description |
---|---|---|
string | Email address |
Additionally for the Push channel:
Parameter | Type | Description |
---|---|---|
provider | string | Provider type |
subscription_id | string | Subscription ID |
Additionally for the SMS channel:
Parameter | Type | Description |
---|---|---|
phone | string | Phone number |
Additionally for the Telegram channel:
Parameter | Type | Description |
---|---|---|
cc_data | object | Chat ID between Telegram bot and user |
Additionally for the WhatsApp* channel:
Parameter | Type | Description |
---|---|---|
cc_data | object | WhatsApp* user's phone number |
*The Meta organization, which owns Instagram, Facebook and WhatsApp products, has been declared as extremist and banned in Russia.