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
  • Resources
  • Segments
    • Get statistics on resource
    • Update statistics on segment
    • Create segment
    • Update segment
    • Get segment information
    • Get segments list
    • Delete segment
  • 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).
  • Segments
  • Update statistics on segment
Documentation for version v72

Update statistics on segment

Description​

Update the subscription statistics of the profiles in the segment.

Returns a response with task ID without waiting for execution.

URL​

Method: POST

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

Request parameters​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
db_idint3Yes, for dynamic requestDatabase ID
resource_idint2YesResource ID
idint1YesSegment ID
formatint"json"NoResponse data format
By default – json

Request example​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"db_id": 1,
"resource_id": 24,
"id": 7,
"format": "json"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<db_id>1</db_id>
<resource_id>24</resource_id>
<id>7</id>
<format>json</format>
</xml>

Response example​

  • JSON
  • XML
{
"data": {
"task_id": "55a345c8-3d79-47ef-b03e-b84ce8e0c126"
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<task_id>55a345c8-3d79-47ef-b03e-b84ce8e0c126</task_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
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": {
"subscribed_sendable": 209,
"unconfirmed_sendable": 0
}
},
{
"channel": "push",
"status": {
"subscribed_sendable": 0,
"unconfirmed_sendable": 0
}
},
{
"channel": "sms",
"status": {
"subscribed_sendable": 0,
"unconfirmed_sendable": 0
}
}
],
"in_progress": false,
"list_id": 1,
"refresh_task_id": "",
"resource_id": 27,
"updated": "2024-04-20T09:30:01.583Z"
}
]
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<status>completed</status>
<progress>100</progress>
<result>
<channels>
<channel>email</channel>
<status>
<subscribed_sendable>209</subscribed_sendable>
<unconfirmed_sendable>0</unconfirmed_sendable>
</status>
</channels>
<channels>
<channel>push</channel>
<status>
<subscribed_sendable>0</subscribed_sendable>
<unconfirmed_sendable>0</unconfirmed_sendable>
</status>
</channels>
<channels>
<channel>sms</channel>
<status>
<subscribed_sendable>0</subscribed_sendable>
<unconfirmed_sendable>0</unconfirmed_sendable>
</status>
</channels>
<in_progress>false</in_progress>
<list_id>1</list_id>
<refresh_task_id></refresh_task_id>
<resource_id>27</resource_id>
<updated>2024-04-20T09:30:01.583Z</updated>
</result>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Last updated on Dec 10, 2024
Previous
Get statistics on resource
Next
Create segment
  • Description
  • URL
  • Request parameters
  • Request example
  • Response example
  • Checking the task status
    • URL
    • Request parameters
    • Request example
    • Response example
© 2015 - 2025 Altcraft, LLC. All rights reserved.