Skip to main content

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

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
idint1YesTrigger campaign ID
formatstring"json"NoResponse data format.
By default – json

Request example

{
"id": 7,
"token": "abcdefghijklmnqrstuvwxyz"
}

Response example

{
"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": ""
}
],
"custom_tracking_domains": [],
"id": 7,
"is_active": true,
"is_random_tracking_prefix": false,
"list_id": 20,
"name": "API call trigger",
"resource_id": 44,
"send_channel": "email",
"skip_minutes": 0,
"subid": "API",
"trigger_type": "api_call",
"virtual_sender_id": 98
},
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
idintTrigger campaign ID
namestringCampaign name
is_activeboolCampaign active flag
contentJSON arrayMessage template object
trigger_typestringTrigger type.
See below
skip_minutesintWaits for X minutes before campaign launch
resource_idintResource ID
send_channelstringSending channel
for_confirmboolMessages with opt-in link flag
policy_idintSending policy ID
descrstringCampaign description
push_sending_modestringPush notification sending mode (push channels only)
Smart settings
virtual_sender_idstringVirtual sender ID
(Smart accounts)
is_random_tracking_prefixboolRandom tracking domain prefix
(Smart accounts)
custom_tracking_domainsJSON arrayTracking domains list
(Smart accounts)
blind_carbon_copyJSON arrayHidden copy email addresses
(Smart accounts)
unconditional_sendingboolSend messages regardless of subscription status
(Smart accounts)

Trigger type parameters

These parameters depend on trigger type specified for a campaign (trigger_type)

ParameterTypeDescriptionapi_callapi_importactionupdatepixelsubscribe
actionstringAction based trigger typeNoNoYesNoNoNo
update_queryJSON array
NoNoNoYesNoNo
link_namestringMessage link nameNoNoYesNoNoNo
message_idintTemplate IDNoNoYesNoNoNo
list_idintDatabase IDYesYesNoYesNoNo
subscribe_resource_idintResource IDNoNoNoNoNoYes
channelstringTrigger channelNoNoNoNoNoYes
is_new_subboolNew resource triggerNoNoNoNoNoYes
is_new_chboolNew channel triggerNoNoNoNoNoYes
is_new_contactboolNew contact triggerNoNoNoNoNoYes
is_status_changedboolSubscription status change triggerNoNoNoNoNoYes
trigger_statusesarray(int)Subscription status change optionsNoNoNoNoNoYes
pixel_idintPixel IDNoNoNoNoYesNo
pixel_targetstringPixel goalNoNoNoNoYesNo

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, -1234
  • bool — Boolean, true or false
  • date — 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

OperatordescriptionLineNumberIPEnumDateBooleanTagsObjectArr_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--------+