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
  • Static segments
  • Suppression lists
  • Templates and fragments
  • Campaigns
    • Activate campaign
    • Deactivate campaign
    • Get campaign list
    • Get campaign information
    • Get campaign log
    • Clone campaign
    • Delete campaign
    • Get campaign status
    • Broadcast campaigns
    • Regular campaigns
    • Trigger campaigns
      • Get trigger campaigns list
      • Get trigger campaign information
      • Create trigger campaign
      • Update trigger campaign
      • Trigger launch (API call)
      • Profile import + trigger campaign launch
      • Task for bulk trigger launch
      • Task for bulk profiles import + trigger launch
      • Bulk trigger launch
      • Bulk profiles import + trigger campaign launch
      • Clone a trigger campaign
      • Data array
  • 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).
  • Campaigns
  • Trigger campaigns
  • Bulk profiles import + trigger campaign launch
Documentation for version v72

Bulk profiles import + trigger campaign launch

Description​

Add or update multiple profiles and then send a trigger campaign.

This request is a batch version of the Profile import + trigger campaign launch request.

note

The request body size is limited by default to 10 Mb, exception for files — 100 Mb.

Request URL​

Method: POST

http://example.com/api/v1.1/campaigns/triggers/import_and_start_batch

Request parameters​

ParametersTypeExampleRequiredDescription
Profile import
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
dataJSON object
[
   {
      "data": {
         "_fname": "John",
         "_lname": "Lambert",
         "email": "profile4@example.com",
         "phones": "+790000000000"
      }
   },
   {
      "data": {
         "_fname": "Tom",
         "_lname": "Hard",
         "email": "profile3@example.com",
         "phones": "+790000000001"
      }
   }
]
YesProfile fields data
skip_triggersbooltrueNoSkip trigger events.
By default – false
skip_invalid_subscriptionsbooltrueNoSkip invalid subscriptions
By default – false
detect_geobooltrueNoDetect location by _regip or _ip from data object
subscription_filterJSON objectPush example:
"subscription_filter": {
   "subscription_id": "CAREFULWITHTHATAXE",
   "provider": "Chrome",
   "not_strict": true
}
Email example:
"subscription_filter": {
   "email": "example@example.com",
   "not_strict": true
}
SMS example:
"subscription_filter": {
   "phone": "+79106135133",
   "not_strict": false
}
NoSelects a profile's subscription to send message

Not used if custom_request is set.

not_strict determines what to do when a certain subscription is not found. If "true" — another fitting subscription will be used instead.
Profile matching mode
matchingstring

"email"
"email_profile"
"phone"
"profile_id"
"custom"

No, if matched by email from profile or subscriptionsProfile matching mode
By default - email
emailstring"john@example.com""matching":"email" - both profile data and subscriptions

"matching":"email_profile" - profile data only
Email address
phonestring"+79000000000""matching":"phone"Phone number
profile_idstring"abcdefghijklmnqrstuvwxyz""matching":"profile_id"Profile ID
field_namestring"CRM_ID""matching":"custom"Custom profile data field name
field_valueint/string"123420""matching":"custom"

Custom profile data field value.

tip

Searching by combination of tags is available for tag type profile fields. Values are recorded as a string: "tag-1, tag-2".

resource_idint24NoResource ID for email and phone matching
Trigger launch
trigger_idint13YesTrigger campaign ID
timeoutJSON object
{
"days": 0,
"hours": 0,
"minutes": 5
}
NoTrigger start timeout. Specify the days, hours, and minutes to set the timeout period.
custom_dataJSON object
{
"sending_time": "12:31:12"
}
NoData used for integration Action hooks
contentJSON object
{
"page": "registration_form"
}
NoData you can use in a message template using {apicontent.fieldname} variable
attachJSON objects array
{
"data": "data:text/csv;base64,SEVMTE8K",
"name": "Attach.txt"
}
NoA file you can attach to an Email message

Response parameters​

ParameterTypeDescription
error_textstringError text
errorintError code
resultarrayIDs of successfully imported profiles

Request example (matching by email)​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"trigger_id": 96,
"format": "json",
"skip_triggers": false,
"detect_geo": true,
"matching": "email",
"data": [
{
"data": {
"_fname": "Lili",
"_lname": "Collins",
"email": "example@example.com",
"phones": "+79000000000",
"subscriptions": [
{
"channel": "email",
"email": "example@example.com",
"priority": 0,
"resource_id": 21,
"status": 0
}
]
}
},
{
"data": {
"_fname": "Eva",
"_lname": "Collins",
"email": "example@example.com",
"phones": "+79000000001",
"subscriptions": [
{
"channel": "email",
"email": "example@example.com",
"priority": 0,
"resource_id": 21,
"status": 0
}
]
}
}
]
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<trigger_id>96</trigger_id>
<format>xml</format>
<skip_triggers>false</skip_triggers>
<detect_geo>true</detect_geo>
<matching>email</matching>
<data>
<_fname>Lili</_fname>
<_lname>Collins</_lname>
<email>example@example.com</email>
<phones>+79000000000</phones>
<subscriptions>
<channel>email</channel>
<email>example@example.com</email>
<priority>0</priority>
<resource_id>21</resource_id>
<status>0</status>
</subscriptions>
</data>
<data>
<_fname>Eva</_fname>
<_lname>Collins</_lname>
<email>example@example.com</email>
<phones>+79000000001</phones>
<subscriptions>
<channel>email</channel>
<email>example@example.com</email>
<priority>0</priority>
<resource_id>21</resource_id>
<status>0</status>
</subscriptions>
</data>
</xml>

Request example (matching by custom field)​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"trigger_id": 85,
"format": "json",
"skip_triggers": false,
"detect_geo": true,
"matching": "custom",
"field_name": "Custom_ID",
"data": [
{
"data": {
"_fname": "Adama",
"_lname": "Fuller",
"email": "example@example.com,
"phones": "+79000000000",
"Custom_ID": "345",
"subscriptions": [
{
"channel": "email",
"email": "example@example.com",
"priority": 0,
"resource_id": 21,
"status": 0
}
]
}
},
{
"data": {
"_fname": "Eva",
"_lname": "Fuller",
"email": "example@example.com",
"phones": "+79000000001",
"Custom_ID": "567",
"subscriptions": [
{
"channel": "email",
"email": "example@example.com",
"priority": 0,
"resource_id": 21,
"status": 0
}
]
}
}
]
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<trigger_id>85</trigger_id>
<format>xml</format>
<skip_triggers>false</skip_triggers>
<detect_geo>true</detect_geo>
<matching>custom</matching>
<field_name>custom_field</field_name>
<data>
<_fname>Irina</_fname>
<_lname>Depp</_lname>
<email>example@example.com</email>
<phones>+79000000000</phones>
<custom_field>343</custom_field>
<subscriptions array='true'>
<channel>email</channel>
<email>example@example.com</email>
<priority>0</priority>
<resource_id>21</resource_id>
<status>0</status>
</subscriptions>
</data>
<data>
<_fname>Will</_fname>
<_lname>Depp</_lname>
<email>example@example.com</email>
<phones>+79000000001</phones>
<custom_field>560</custom_field>
<subscriptions array='true'>
<channel>email</channel>
<email>example@example.com</email>
<priority>0</priority>
<resource_id>21</resource_id>
<status>0</status>
</subscriptions>
</data>
</xml>

Response example​

  • JSON
  • XML
{
"error": 0,
"error_text": "Successful operation",
"result": [
{
"profile_id": "602103d65ae47a3bc65d5d83"
},
{
"profile_id": "601ec71c5ae47a15d1c9b472"
}
]
}
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
<result>
<element>
<profile_id>602103d65ae47a3bc65d5d83</profile_id>
</element>
<element>
<profile_id>601ec71c5ae47a15d1c9b472</profile_id>
</element>
</result>
</xml>

Response example when a request constraint is triggered​

  • JSON
  • XML
{
"error": 400,
"error_debug": "http: request body too large",
"error_text": "Invalid request"
}
<xml>
<error>400</error>
<error_debug>http: request body too large</error_debug>
<error_text>"Invalid request"</error_text>
</xml>
Last updated on Aug 2, 2024
Previous
Bulk trigger launch
Next
Clone a trigger campaign
  • Description
  • Request URL
  • Request parameters
  • Response parameters
  • Request example (matching by email)
  • Request example (matching by custom field)
  • Response example
  • Response example when a request constraint is triggered
© 2015 - 2025 Altcraft, LLC. All rights reserved.