Get trigger campaign information
Description
Retrieves detailed information about a trigger campaign.
Request URL
Method: POST
https://example.com/api/v1.1/campaigns/triggers/get
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| id | int | 1 | Yes | Trigger campaign ID |
| format | string | "json" | No | Response data format. By default – json |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 12
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>12</id>
</xml>
Response example
- JSON
- XML
{
"data": {
"call_url": "trk.test.test.altcraft.com/trg/465ea6fedf0a75fafe1a413943aae3696d95939038311994/<email|md5|xxh>",
"content": [
{
"from_email": "",
"from_name": "",
"message_id": 41,
"replyto_email": "",
"replyto_name": "",
"subject": ""
}
],
"send_channel": "email",
"custom_tracking_domains": [],
"id": 7,
"is_active": true,
"is_random_tracking_prefix": false,
"list_id": 20,
"name": "API call trigger",
"resource_id": 44,
"skip_minutes": 0,
"subid": "API",
"trigger_type": "api_call",
"virtual_sender_id": 98
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<blind_carbon_copy/>
<call_url>http://trk.test.test.altcraft.com:8095/trg/65512f8ec196edd63e50585b4bfd377365512f8ec196edd62f3de6b87e2969e3/
<email|md5|xxh>
</call_url>
<channel>0</channel>
<content>
<from_email/>
<from_name/>
<message_id>8</message_id>
<replyto_email/>
<replyto_name/>
<subject/>
</content>
<custom_tracking_domains/>
<description/>
<for_confirm>false</for_confirm>
<id>12</id>
<is_active>true</is_active>
<is_new_ch>false</is_new_ch>
<is_new_contact>false</is_new_contact>
<is_new_sub>false</is_new_sub>
<is_random_tracking_prefix>false</is_random_tracking_prefix>
<is_status_changed>false</is_status_changed>
<list_id>1</list_id>
<name>New trigger campaign 3</name>
<policy_id>0</policy_id>
<resource_id>4</resource_id>
<send_channel>email</send_channel>
<skip_minutes>0</skip_minutes>
<skip_unique_checking>false</skip_unique_checking>
<start_schedule>
<losers>false</losers>
<profile>false</profile>
<start_hours/>
<start_mdays/>
<start_mins/>
<start_months/>
<start_wdays/>
<start_years/>
<tz/>
</start_schedule>
<sub_cats_filter/>
<sub_fields_filter/>
<subid/>
<subscribe_resource_id>0</subscribe_resource_id>
<trigger_type>api_call</trigger_type>
<unconditional_sending>false</unconditional_sending>
<update_time>2024-02-15T20:45:00.705Z</update_time>
<updated_user>roman</updated_user>
<virtual_sender_id>0</virtual_sender_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| id | int | Trigger campaign ID |
| name | string | Campaign name |
| is_active | bool | Campaign active flag |
| content | JSON array | Message template object |
| trigger_type | string | Trigger type. See below |
| skip_minutes | int | Waits for X minutes before campaign launch |
| resource_id | int | Resource ID |
| send_channel | string | Sending channel |
| for_confirm | bool | Messages with opt-in link flag |
| policy_id | int | Sending policy ID |
| descr | string | Campaign description |
| push_sending_mode | string | Push notification sending mode (push channels only) |
| attributes | object | Attributes assigned to campaign |
| Smart settings | ||
| virtual_sender_id | string | Virtual sender ID (Smart accounts) |
| is_random_tracking_prefix | bool | Random tracking domain prefix (Smart accounts) |
| custom_tracking_domains | JSON array | Tracking domains list (Smart accounts) |
| blind_carbon_copy | JSON array | Hidden copy email addresses (Smart accounts) |
| unconditional_sending | bool | Send messages regardless of subscription status (Smart accounts) |
Trigger type parameters
These parameters depend on trigger type specified for a campaign (trigger_type)
| Parameter | Type | Description | api_call | api_import | action | update | pixel | subscribe |
|---|---|---|---|---|---|---|---|---|
| action | string | Action based trigger type | No | No | Yes | No | No | No |
| update_query | JSON array | No | No | No | Yes | No | No | |
| link_name | string | Message link name | No | No | Yes | No | No | No |
| message_id | int | Template ID | No | No | Yes | No | No | No |
| list_id | int | Database ID | Yes | Yes | No | Yes | No | No |
| subscribe_resource_id | int | Resource ID | No | No | No | No | No | Yes |
| channel | string | Trigger channel | No | No | No | No | No | Yes |
| is_new_sub | bool | New resource trigger | No | No | No | No | No | Yes |
| is_new_ch | bool | New channel trigger | No | No | No | No | No | Yes |
| is_new_contact | bool | New contact trigger | No | No | No | No | No | Yes |
| is_status_changed | bool | Subscription status change trigger | No | No | No | No | No | Yes |
| trigger_statuses | array(int) | Subscription status change options | No | No | No | No | No | Yes |
| pixel_id | int | Pixel ID | No | No | No | No | Yes | No |
| pixel_target | string | Pixel goal | No | No | No | No | Yes | No |
trigger_type: action
Represents message action based trigger.
It has 3 additional parameters.
Two of them are: "action": "<action name>" and "message_id": 123. They specify associated message and a message action.
"link_name": "String" property cpecifies link name when "action": "click_sms" or "action": "clicklink_sms".
"action": "open"— email opened."action": "read"— email read"action": "click"— any link clicked in email message"action": "confirm"— opt-in link clicked"action": "click_sms"— any click in SMS message"action": "clicklink"— a specific email link clicked,"link_name": "String""action": "clicklink_sms"— a specific SMS link clicked,"link_name": "String"
trigger_type: api_import
Represents API profile import trigger.
Retrieves import database ID "list_id": 32.
trigger_type: pixel
Represents pixel activation trigger type.
Has two additional parameters:
"pixel_id": 64— Altcraft pixel unique ID."pixel_target": "Target-name"— Pixel goal name.
trigger_type: update
Represents profile fields update trigger.
Has two additional parameters:
"list_id": 32— profile database ID."update_query": {"fieldname": "_postal_code", "fieldtype": "unicode", "operator": "equal", "value": "800028"}— trigger conditions.
Update query
"fieldname": "_postal_code"— field name. Custom fields are used by their custom names. System and default fields have preset names."fieldtype": "unicode"— data type for custom and default database fields."operator": "equal"— logical operator."value": "800028"— value expected by trigger."submatch": "object_key"— property path. When the value of this property changes, the trigger will fire. Only used with the object and arr_object field types.
Field types
field types can be the following:
unicode— a string of characters or numbers,"a1b2c"int— an integer number,-1234bool— Boolean,true or falsedate— date in string format,"2000-10-24T00:00:00.000Z"tags— tags, an array of strings,["T1", "Tag2"]enum— a map composed of key-value pairs{"item_one": 1, "item_two": 2}object— object,{"A": "B", "C": "D"};arr_object— array of objects,[{"A": 1},{"B": 2}]
Query logical operators
| Operator | description | Line | Number | IP | Enum | Date | Boolean | Tags | Object | Arr_object |
|---|---|---|---|---|---|---|---|---|---|---|
| "equal" | value gets equal | + | + | + | + | + | + | - | - | - |
| "not_equal" | value gets not equal | + | + | + | + | + | + | - | - | - |
| "not_exists_or_empty" | value unset or field removed | + | + | + | + | + | + | - | + | + |
| "not_empty_or_exists" | value set or field added | + | + | + | + | + | + | - | + | + |
| "tag_added_any" | any tag added | - | - | - | - | - | - | + | - | - |
| "tag_removed_any" | any tag removed | - | - | - | - | - | - | + | - | - |
| "equal_property" | if the value of the specified property becomes equal to | - | - | - | - | - | - | - | + | + |
| "not_equal_property" | if the value of the specified property becomes not equal to | - | - | - | - | - | - | - | + | + |
| "added_element" | if a new element is added to the array | - | - | - | - | - | - | - | - | + |
| "deleted_element" | if one of the elements is removed from the array | - | - | - | - | - | - | - | - | + |