Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v72
  • v74
  • v73
  • v72
Login
  • User API documentation
  • API interaction
  • Matching
  • Profiles
  • Databases
    • Get database statistics
    • Update statistics on database
    • Get database list
    • Get database information
    • Get database fields
    • Database wipe
  • Resources
  • Segments
  • Static segments
  • Suppression lists
  • Templates and fragments
  • Campaigns
  • Automation scenarios
  • Promo codes
  • Goals
  • Application push notifications
  • Market
  • Analytic reports
  • SendersDevv71
  • External datatables queries
  • Objects
  • Miscellaneous
  • Importing the API collection in Postman
  • List of API endpoints
  • SDK
This is documentation for Altcraft Platform v72. This documentation is no longer maintained.
The information for up-to-date platform version at this page is available (v74).
  • Databases
  • Update statistics on database
Documentation for version v72

Update statistics on database

Description​

Update subscription statistics of profiles in the database.

Returns a response with task ID without waiting for execution.

URL​

Method: POST

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

Request parameters​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
idint1YesDatabase ID
resource_idint1YesResource 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​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 5,
"resource_id": 24,
"format": "json",
"feedback": {
"type": "JSON",
"url": "http://example.com/receiver"
}
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>5</id>
<resource_id>24</resource_id>
<format>json</format>
<feedback>
<type>JSON</type>
<url>http://example.com/receiver</url>
</feedback>
</xml>

Response example​

  • JSON
  • XML
{
"data": {
"task_id": "6908adeb-346e-4f5e-9f68-df062bf795cf"
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<task_id>6908adeb-346e-4f5e-9f68-df062bf795cf</task_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>

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​

  • JSON
  • XML
{
"task_id": "930bfdb0-a5a8-4207-a77d-6b989bdea326",
"token": "abcdefghijklmnqrstuvwxyz"
}
<xml>
<task_id>930bfdb0-a5a8-4207-a77d-6b989bdea326</task_id>
<token>abcdefghijklmnqrstuvwxyz</token>
</xml>

Response example​

  • JSON
  • XML
{
"data": {
"status": "completed",
"progress": 100,
"result": [
{
"channels": [
{
"channel": "email",
"status": {
"all": 1336,
"complained": 0,
"hardbounced": 411,
"invalid": 0,
"subscribed": 925,
"subscribed_sendable": 925,
"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": "sms",
"status": {
"all": 1336,
"complained": 0,
"hardbounced": 0,
"invalid": 0,
"subscribed": 0,
"subscribed_sendable": 0,
"suspended": 0,
"unconfirmed": 0,
"unconfirmed_sendable": 0,
"unsubscribed": 0
}
}
],
"in_progress": false,
"last_count_time": "counted at 2024-04-17T21:36:01Z in 82.746959ms",
"refresh_task_id": "",
"resource_id": 24,
"total_count": 1336,
"updated": "2024-04-17T21:36:01.449Z"
}
]
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<status>completed</status>
<progress>100</progress>
<result>
<channels>
<channel>email</channel>
<status>
<all>1336</all>
<complained>0</complained>
<hardbounced>411</hardbounced>
<invalid>0</invalid>
<subscribed>925</subscribed>
<subscribed_sendable>925</subscribed_sendable>
<suspended>0</suspended>
<unconfirmed>0</unconfirmed>
<unconfirmed_sendable>0</unconfirmed_sendable>
<unsubscribed>0</unsubscribed>
</status>
</channels>
<channels>
<channel>push</channel>
<status>
<all>1336</all>
<complained>0</complained>
<hardbounced>0</hardbounced>
<invalid>0</invalid>
<subscribed>0</subscribed>
<subscribed_sendable>0</subscribed_sendable>
<suspended>0</suspended>
<unconfirmed>0</unconfirmed>
<unconfirmed_sendable>0</unconfirmed_sendable>
<unsubscribed>0</unsubscribed>
</status>
</channels>
<channels>
<channel>sms</channel>
<status>
<all>1336</all>
<complained>0</complained>
<hardbounced>0</hardbounced>
<invalid>0</invalid>
<subscribed>0</subscribed>
<subscribed_sendable>0</subscribed_sendable>
<suspended>0</suspended>
<unconfirmed>0</unconfirmed>
<unconfirmed_sendable>0</unconfirmed_sendable>
<unsubscribed>0</unsubscribed>
</status>
</channels>
<in_progress>false</in_progress>
<last_count_time>counted at 2024-04-17T21:36:01Z in 82.746959ms</last_count_time>
<refresh_task_id></refresh_task_id>
<resource_id>24</resource_id>
<total_count>1336</total_count>
<updated>2024-04-17T21:36:01.449Z</updated>
</result>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Last updated on Nov 13, 2024
Previous
Get database statistics
Next
Get database list
  • Description
  • URL
  • Request parameters
  • Request example
  • Response example
  • Response parameters
  • Checking the task status
    • URL
    • Request parameters
    • Request example
    • Response example
© 2015 - 2025 Altcraft, LLC. All rights reserved.