Skip to main content

Action hook message structure

Action hook structure

ParameterTypeExampleDescription
event_typestring"click"Event from captured events table.
event_datestring"2018-03-25T13:13:19.034315796Z"Event date in RFC 3339 format.
_xxhstring"ad1850e0d1d9481e"Eemail XXHash used for profile identification.
_md5string"145bb30f7ddf1184cb560bc4b7705646"MD5 hash used for profile identification.
list_idint111Event database ID
account_idint23Event Account ID
is_testboolfalseTesting event flag
custom_dataJSON object
{"email": "alice@example.org"}
A custom set of customer profile fields and values you specify in action hook settings.
event_dataJSON object
{"browser": "Firefox"}
Event based data object. This can be tracking data, messaging data or pixel data.

event_data structure for tracking events

Tracking events are:

  • uopen, open, uclick, click, confirm, confirmsub, unsub, read, glanced, skimmed,
  • uclick_sms, click_sms, uclick_sms, unsub_sms,
  • uopen_push, open_push, click_push, uclick_push.
ParameterTypeExampleDescription
message_idint17Template ID
campaign_idint973Campaign ID
segment_idint0Segment ID
ipstring"10.9.0.14"IPv4address
countrystring".ru"Country top level domain
citystring"Moscow"City
postal_codestring"390000"Postal code
regionstring"Moskovskaya oblast"Region
tzstring"Europe/Vaduz"Time zone
latfloat55.244075Geographic latitude
lonfloat55.244075Geographic longitude
user_agentstring"Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"User agent request head info
osstring"Linux" x86_64Operating system
browserstring"Firefox"Browser, version
devicestring"web"Device
link_urlstring"http://www.example.com"HTTP redirect link
launch_idstring"00000017000003cd5a9bf01a"Launch unique ID.
send_message_idstring"5a9bf01a17_3cd_11_6f_0_2.5a8c045fc1dde44cbf718f78"Message sending ID.
extra_uidstring"ew4Sgf41Qwjq8_2_2E_w_k___t.2SDvJv8bvBYQFtSDx_7bTV2f.2_2E_4Sgf41DXc7Z_D"Extra UID. Only for the push channel.

event_data structure for messaging events

Messaging events are the following:

  • send, deliv, undeliv, suppress, sbounce, hbounce, complain,
  • send_sms, deliv_sms, undeliv_sms,
  • send_push, deliv_push.
ParameterTypeExampleDescription
message_idint17Template ID
campaign_idint973Campaign ID
segment_idint0Segment ID
bounce_codeint500Email provider response codes for soft and hard bounces
bounce_messageString"No such email"Email provider response messages for soft and hard bounces
launch_idstring"00000017000003cd5a9bf01a"Launch unique ID.
send_message_idstring"5a9bf01a17_3cd_11_6f_0_2.5a8c045fc1dde44cbf718f78"Message sending ID.
extra_uidstring"ew4Sgf41Qwjq8_2_2E_w_k___t.2SDvJv8bvBYQFtSDx_7bTV2f.2_2E_4Sgf41DXc7Z_D"Extra UID. Only for the push channel.

event_data structure for AK-Pixel events

A complete list of possible parameters can be found in this article.

ParameterTypeExampleDescription
ipstring"10.9.0.14"IPv4 address
countrystring".ru"Country top level domain
citystring"Moscow"City
postal_codestring"390000"Postal code
regionstring"Moskovskaya oblast"Region
tzstring"Europe/Vaduz"Time zone
latfloat55.244075Geographical latitude
lonfloat55.244075Geographical longitude
user_agentstring"Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"User-Agent request head value
osstring"Linux x86_64Operating system"
browserstring"Firefox"Browser, version
devicestring"web"Device

event_data structure for promocode events

Promocode events include promocode_attach, promocode_detach, promocode_activate:

ParameterTypeExampleDescription
attachedstring"2020-10-02T13:28:52Z"Time and date of attaching promocode to a profile
detachedstring"2020-10-02T13:28:52Z"Time and date of detaching promocode to a profile
activatedstring"2020-10-02T13:28:52Z"Time and date when promocode is activated to a profile
codestring"TEST-XOUH-KBJM-J5K9-24I1"Promocode
db_idint123456Profile database ID
loyalty_idint9Loyalty program ID
profile_idstring"000000000000000000000000"Profile ID

All dates are specified in RFS 3339 format.

event_data structure for segment events

Segments events are segs_add and segs_remove:

ParameterTypeExampleDescription
campaign_idint9Campaign ID
launch_idstring""Launch unique ID.
message_idint0Template ID
segment_idint80Segment ID
send_message_idstring""Message sending ID.

event_data structure for profile merge events

There are profile_merge and profile_split events:

ParameterTypeExampleDescription
destinationarray
[
{
"custom_data": {
"age": 25
},
"db_id": 94,
"profile_id": "608a8960e3224a6be26a71df"
}
]

If profiles are merged, it contains the profile matching data that will result from the merging.

If the profile is split, it contains the profile matching data that will result from the split.

sourcearray
[
{
"custom_data": {
"age": 25
},
"db_id": 94,
"profile_id": "608a8960e3224a6be26a71df"
}
]

If profiles are merged, it contains matching data about the profiles to be merged.

If the profile is split, it contains matching data about the profiles to be split.

event_data structure for Telegram events

This type of event includes telegram_bot_send, telegram_bot_deliv, telegram_bot_click, telegram_bot_uclick, telegram_bot_undeliv, telegram_group_send, telegram_group_deliv, telegram_group_click, telegram_group_undeliv:

ParameterTypeExampleDescription
campaign_idint9Campaign ID in Altcraft
launch_idstring""Campaign launch ID.
message_idint0Message template ID in Altcraft
resource_idint3Resource ID in Altcraft
segment_idint80Segment ID if available
send_message_idstring""Sent message ID

event_data structure for campaign error events

This is camp_error event type exclusively.

ParameterTypeExampleDescription
campaign_idint9Campaign ID in Altcraft
error_codeint500
Error code
error_textstring"LOG_INTERNAL_ERROR"Error text
launch_idstring""Campaign launch ID.
message_idint0Message template ID in Altcraft
resource_idint3Resource ID in Altcraft
segment_idint80Segment ID if available
send_message_idstring""Sent message ID

event_data structure for campaign launch events

This is campaign_launch event type exclusively.

ParameterTypeExampleDescription
event_typestring"campaign_launch"Event from captured events table.
event_datestring"2018-03-25T13:13:19.034315796Z"Event date in RFC 3339 format.
account_idint23Event Account ID
is_testboolfalseTesting event flag
event_dataJSON objectSee below campaign_id — campaign ID
campaign_type — campaign type
campaign_name — campaign name
campaign_sub_id — campaign SubID
data_type — audience source type
data_id — audience source ID
launch_id — account base16 ID and timestamp
content — campaign messages

Campaign launch message example

{
"event_type": "campaign_launch",
"event_date": "2016-12-09T10:11:24.934079204Z",
"is_test": false,
"account_id": 161,
"event_data": {
"campaign_id": 1472,
"campaign_type": "broadcast",
"campaign_name": "Campaugn Launch Hook",
"campaign_sub_id": "x11"
"data_type": "segment",
"data_id": 1221,
"launch_id": "000000a1000005c0584a834c",
"content": [
{
"message_name": "Hello",
"message_id": 1412,
"suppress_id": 271,
"replyto_email": "",
"replyto_name": "",
"text": "message text version",
"html": "<html> html message version </html>",
"from_name": "",
"from_email": "",
"attach_links": [],
"subject": "Hello, {your_name}!"
},
{
"message_name": "Hi",
"message_id": 1413,
"suppress_id": 272,
"replyto_email": "monty@altcraft.com",
"replyto_name": "Monty",
"text": "message text version",
"html": "<html> html message version </html>",
"from_name": "",
"from_email": "",
"attach_links": [
{
"name": "text_file.txt",
"url": "http://test.altcraft.com/api/attach/link/text_file.txt?token=eyJh..."
},
{
"name": "picture_file.png",
"url": "http://test.altcraft.com/api/attach/link/picture_file.png?token=eyJh..."
}
],
"subject": "Hi, {your_name}!"
}
]
}
}

content structure

If the "Add messages content" option is activated in the webhook settings, then the content field is added to the general structure of the hook message.

{
"content": {
"amp": "<html amp4email></html>",
"from_email": "no-reply@altcraft.com",
"from_name": "Altcraft",
"html": "<html></html>",
"replyto_email": "example@example.com",
"replyto_name": "Altcraft",
"subject": "Weather alert",
"text": "Text version",
"to_email": "profile@example.com",
"to_name": "Fname Lname",
"webversion_email_html": "http://click.altkraft.com/0000/path.html",
"webversion_email_text": "http://click.altkraft.com/0000/path.txt"
},
}
ParameterTypeExampleDescription
ampstring<html amp4email></html>AMP version of email
from_emailstring"no-reply@altcraft.com"Sender Email
from_namestring"Altcraft"Sender name
htmlstring<html></html>HTML version of email
replyto_emailstring"example@example.com"Email for replies
replyto_namestring"Altcraft"Reply receiver name
subjectstring"Weather alert"Email subject
textstring"Text version is important..."Text version of email
to_emailstring"profile@example.com"Receiver Email
to_namestring"Fname Lname "Receiver profile name
webversion_email_htmlstringhttp://click.altkraft.comLink to web version of email
webversion_email_textstringhttp://click.altkraft.comLink to text version of email

A link to the web version of the message is passed in the content object only for the send event in email, sms and push channels. For other events, as well as for the send event in a custom channel, the content object contains the webversion_link field with an empty string:

"content": {
"webversion_link": ""
}