Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v74
  • v74
  • v73
  • v72
Login
  • User API documentation
  • API interaction
  • Matching
  • Profiles
  • Databases
  • Resources
  • Segments
  • Suppression lists
  • Templates and fragments
  • Campaigns
  • Mailings
  • Automation scenarios
  • Loyalty Programs
  • Promo codes
  • Goals
  • Application push notifications
  • Market
  • Analytic reports
  • SendersDev
  • External datatables queries
    • Segmentation queries
      • Add segmentation query
      • Update segmentation query
      • Get segmentation query information
      • Get segmentation queries list
      • Delete segmentation query
    • Template queries
  • Objects
  • Miscellaneous
  • Importing the API collection in Postman
  • List of API endpoints
  • SDK
  • External datatables queries
  • Segmentation queries
  • Add segmentation query
Documentation for version v74

Add segmentation query

Description​

Add segmentation query to external datatables.

Request URL​

Method: POST

https://example.com/api/v1.1/datatables/query_segments/add/

Request parameters​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
namestring"Main query"YesQuery name
shortnamestring"query1"YesQuery shortname
descriptionstring"query to the DB"NoQuery description
connector_idint2YesExternal DB ID
columnstring"author"YesColumn used to search for profiles
sqlstring"SELECT * FROM table"NoSQL query
cache_time_minint35NoResult caching time
groups_id[]int[ 0, 1 ]NoList of group IDs to search for<br/>default – []<br/>
parametersarray
[{
"name": "CITY",
"type": "string",
"title": "head",
"options_type": "query"
}]
NoParameters of user variables used in SQL queries

Request example​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"name": "Main Query",
"shortname": "query1",
"sql": "SELECT * FROM table",
"connector_id": 1,
"column": "price"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<name>Main Query</name>
<shortname>query1uery</shortname>
<sql>SELECT * FROM table</sql>
<connector_id>1</connector_id>
<column>price</column>
</xml>

Response example​

  • JSON
  • XML
{
"data": {
"saved_id": 1
},
"error": 0,
"error_text": "Successful operation",
}
<xml>
<data>
<saved_id>1</saved_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>t>
</xml>

Response parameters​

ParameterTypeDescription
errorintError code
error_textstringError text
saved_idintCreated query ID
Last updated on Sep 30, 2024
Previous
Segmentation queries
Next
Update segmentation query
  • Description
  • Request URL
  • Request parameters
  • Request example
  • Response example
  • Response parameters
© 2015 - 2025 Altcraft, LLC. All rights reserved.