Skip to main content

Update statistics on resource

Description

Update subscription statistics of resource.

Returns a response with task ID without waiting for execution.

URL

Method: POST

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

Request

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
idint1YesResource ID
list_idint1YesDatabase ID
formatJSON object "json"No Response data format
By default – json
feedbackJSON object
"feedback": {
"type": "JSON",
"url": "http://example.com/receiver"
}
NoParameter defining the method of sending data about statistics update.
Parameter "type" - the format or method used to send the data.
"url" - the URL to which the statistics data will be sent.

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 24,
"list_id": 1,
"format": "json",
"feedback": {
"type": "JSON",
"url": "http://example.com/receiver"
}
}

Response example

{
"data": {
"task_id": "c9c3ec48-1bef-4969-9c1a-df39f0c179bb"
},
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
dataJSON objectsContains the task identifier - task_id
errorintError code
error_textstringError text

Checking the task status

URL

Method: POST

https://example.com/api/v1.1/tasks/status

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
task_idstring"518f4997-ec43-4df5-bfd0-093aaacf679f"YesTask ID

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"task_id": "c9c3ec48-1bef-4969-9c1a-df39f0c179bb"
}

Response example

{
"data": {
"status": "completed",
"progress": 100,
"result": [
{
"channels": [
{
"channel": "sms",
"status": {
"all": 1336,
"complained": 0,
"hardbounced": 0,
"invalid": 0,
"subscribed": 0,
"subscribed_sendable": 0,
"suspended": 0,
"unconfirmed": 0,
"unconfirmed_sendable": 0,
"unsubscribed": 0
}
},
{
"channel": "push",
"status": {
"all": 1336,
"complained": 0,
"hardbounced": 0,
"invalid": 0,
"subscribed": 0,
"subscribed_sendable": 0,
"suspended": 0,
"unconfirmed": 0,
"unconfirmed_sendable": 0,
"unsubscribed": 0
}
},
{
"channel": "email",
"status": {
"all": 1336,
"complained": 0,
"hardbounced": 434,
"invalid": 0,
"subscribed": 842,
"subscribed_sendable": 842,
"suspended": 0,
"unconfirmed": 0,
"unconfirmed_sendable": 0,
"unsubscribed": 60
}
}
],
"in_progress": false,
"last_count_time": "counted at 2024-04-19T13:31:08Z in 231.374251ms",
"list_id": 1,
"refresh_task_id": "",
"updated": "2024-04-19T13:31:08.927Z"
}
]
},
"error": 0,
"error_text": "Successful operation"
}