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
  • Trigger launch (API call)
Documentation for version v72

Trigger launch (API call)

Top priority instantly launched trigger campaigns.

tip

To launch a trigger at the precise time of a new profile import you can use Import + trigger request.

Version 1.1​

Description​

It has several advantages compared with API V. 1.0:

  • Requests can change campaign content for each launch.
  • Sends messages to an audience instead of single profiles.
  • Advanced audience matching — profile ID, custom fields, external database queries.
  • API token in message body for advanced security.

Static request URL /api/v1.1/campaigns/triggers/start/ as compared to a dynamically generated link bound to a certain profile database.

Request URL​

Method: POST

https://example.com/api/v1.1/campaigns/triggers/start/

Request parameters​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
idstring5511YesTrigger campaign ID
contentJSON object{ "field": "value" }NoAdditional content for API content filter node
and template apicontent variables
attachJSON array[]NoAttach file(s) to campaign messages
custom_dataJSON object{ "x": "y"}NoData used for integration action hooks
Profile matching mode
matchingstring"email"
"phone"
"profile_id"
"custom"
No, if matched by emailProfile matching mode
By default - email
emailstring"john@example.com""matching":"email"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
custom_requestJSON object
{
"email": {
"$in": [
"asd@dsfsd.com",
"zxcv@sdfsd.com"
]
}
}
When no matching
specified
Custom MongoDB database query
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.

Request example​

This example triggers a campaign for a single subscriber:

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 84,
"matching": "profile_id",
"profile_id": "abcdefghijklmnqrstuvwxyz"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>84</id>
<matching>profile_id</matching>
<profile_id>abcdefghijklmnqrstuvwxyz</profile_id>
</xml>

Send messages to subscribers with Custom_IDs from a list ["IpHicQquekzYkufl", "xzFKLXeaJkCYHuMb", "SRNOwHVZiWFItJhr"].

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 84,
"custom_request":{"Custom_ID": {"$in": ["IpHicQquekzYkufl", "xzFKLXeaJkCYHuMb", "SRNOwHVZiWFItJhr"]}}
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>84</id>
<custom_request>{"Custom_ID": {"$in": ["IpHicQquekzYkufl", "xzFKLXeaJkCYHuMb", "SRNOwHVZiWFItJhr"]}}</custom_request>
</xml>

Insert text "New videos on your favorite channels" to replace {apicontent.email_title} message content variable.

Attach files "日本.txt" and US.txt".

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 96,
"matching": "profile_id",
"profile_id": "6606e08f10bcdd88297057a7",
"attach": [
{
"data": "data:text/csv;base64,5LuK5pel44GvCg==",
"name": "日本.txt"
},
{
"data": "data:text/csv;base64,SEVMTE8K",
"name": "US.txt"
}
],
"content": {
"data_lines": [
"Channel A",
"Channel B"
],
"email_title": "New videos on your favorite channels"
}
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>96</id>
<matching>profile_id</matching>
<profile_id>6606e08f10bcdd88297057a7</profile_id>
<attach>
<data>data:text/csv;base64,5LuK5pel44GvCg==</data>
<name>日本.txt</name>
</attach>
<attach>
<data>data:text/csv;base64,SEVMTE8K</data>
<name>US.txt</name>
</attach>
<content>
<data_lines>Channel A</data_lines>
<data_lines>Channel B</data_lines>
<email_title>New videos on your favorite channels</email_title>
</content>
</xml>

Response example​

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

Version 1.0​

Description​

Methods: GET, POST

In this version, each API trigger has a unique link that is displayed after it is created.

http://<your.tracking.domain>/trg/<base16_value_d1d93d9cca76a7c1742a2f23fbacd>/<email|md5|xxh>

The link will change if you change the trigger database.

Using link 1.0 allows you to send a trigger to only one profile per request.

"email" is a deprecated parameter.

GET request {#Triggerlaunch(APIcall)-Method:GET}​

Sends a message with no optional parameters.

Matches profiles by email, md5 hash or XX hash. XX hash profile matching example:

http://trk.example.org/trg/465ea6fedf0a75fa9ee0b5fb8f9d5fe89af34054909af8bb/dd78094ad0e36ca3

POST JSON request {#Triggerlaunch(APIcall)-Method:POST}​

The same link is used as in the GET request.

http://trk.example.org/trg/465ea6fedf0a75fa9ee0b5fb8f9d5fe89af34054909af8bb/dd78094ad0e36ca3

With POST method you have an option to attach JSON data to message body.

You can override database field values for a campaign message or even update database fields.

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 96,
"matching": "profile_id",
"profile_id": "6606e08f10bcdd88297057a7",
"fields": [
{
"name": "FirstName",
"value": "Jason",
"option": 0
},
{
"name": "Order",
"value": "123abc456-78",
"option": 1
}
]
}
<xml>
<token>2fefb577533d4cae919350c450755239</token>
<id>96</id>
<matching>profile_id</matching>
<profile_id>6606e08f10bcdd88297057a4</profile_id>
<fields>
<name>FirstName</name>
<value>Jason</value>
<option>0</option>
</fields>
<fields>
<name>Order</name>
<value>123abc456-78</value>
<option>1</option>
</fields>
</xml>
  • "name" — profile database field name. If no field matches this name — it won't be used.
  • "value" — profile database field value. Must match field data type.
  • "option" — ( 0 | 1 | 2 ) determines data usage options.
  • "option": 0 — if a database field is not empty — request data will be ignored.
  • "option": 1 — request field value will be used in the message, but will not rewrite database value.
  • "option": 2 — request field value will be used in the message and will rewrite database value.
Last updated on Aug 20, 2024
Previous
Update trigger campaign
Next
Profile import + trigger campaign launch
  • Version 1.1
    • Description
    • Request URL
    • Request parameters
    • Request example
    • Response example
  • Version 1.0
    • Description
    • GET request {#Triggerlaunch(APIcall)-Method}
    • POST JSON request {#Triggerlaunch(APIcall)-Method}
© 2015 - 2025 Altcraft, LLC. All rights reserved.