Action Hook Message Structure
General structure
General hook message structure for most event types:
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| event_type | string | Yes | "click" | Event name as in the event types table |
| event_date | string | Yes | "2018-03-04T13:13:19.034315796Z" | Event timestamp in RFC 3339 format |
| profile_id | string | No | "abcdefgh12345678" | Recipient profile ID |
| _xxh | string | No | "ad1850e0d1d9481e" | Subscriber email hash used for identification in Altcraft |
| _md5 | string | No | "145bb30f7ddf1184cb560bc4b7705646" | MD5 hash of the subscriber's email |
| list_id | int | No | 111 | Database ID where the event occurred |
| account_id | int | Yes | 23 | Account ID where the event occurred |
| sends_trying_num | int | No | 2 | Number of message sending attempts (present only if the number of attempts is greater than 0) |
| is_test | bool | Yes | false | Whether the event was triggered by a test send |
| is_static | bool | No | false | Whether dynamic substitutions were used in the sent content |
| subscription_hash_id | string | No | "0a4b910312345" | Subscription hash |
| custom_data | JSON object | No | {"alice@example.org"} | Subscriber data set configured in the Action Hook editing interface |
| event_data | JSON object | Yes | {"browser": "Firefox"} | Data set that depends on the event type (there are two types: tracking events and events that occur during delivery) |
| subscription | array | No | [ | Array with subscription details including information about the resource, communication channel, recipient, and subscription status. The structure is described below. |
When exporting historical events, message content is not transferred. Events are sent in the same format as in real time, and null is passed for deleted profiles.
event_data structure
Tracking events
For the following event types:
- Email: uopen, open, uclick, click, confirm, confirmsub, unsub, read, glanced, skimmed
- SMS: uclick_sms, click_sms, unsub_sms
- Push: uopen_push, open_push, click_push, uclick_push
| Parameter | Type | Example | Required | For which channel | Description |
|---|---|---|---|---|---|
| message_id | int | 17 | Yes | Email, SMS, Push | Message ID in the Altcraft system |
| campaign_id | int | 973 | Yes | Email, SMS, Push | Campaign ID in the Altcraft system |
| scampaign_id | int | 973 | No | For all | Scenario ID in the Altcraft system |
| segment_id | int | 0 | No | Email, SMS, Push | Segment ID, if available |
| resource_id | int | 3 | Yes | Email, SMS, Push | Resource ID |
| ip | string | "10.9.0.14" | No | Email, Push | Subscriber IPv4 address |
| country | string | ".us" ".ru" | No | Email, Push | Country in TLD format |
| city | string | "New York" "Moscow" | No | Email, Push | Subscriber city |
| postal_code | string | "101000" | No | Email, Push | Subscriber postal code |
| region | string | "Ohio" "Moskovskaya oblast" | No | Email, Push | Subscriber region |
| tz | string | "Europe/Vaduz" | No | Email, Push | Subscriber time zone |
| lat | float | 55.244075 | No | Email, Push | Geographic latitude |
| lon | float | 55.244075 | No | Email, Push | Geographic longitude |
| user_agent | string | "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" | No | Email, Push | User-Agent header string |
| os | string | "Linux x86_64" | No | Email, Push | Operating system |
| browser | string | "Firefox" | No | Email, Push | Browser and version |
| device | string | "web" | No | Email, Push | Device |
| link_url | string | "http://www.example.com" | No | Email, SMS, Push | HTTP link the user was redirected to |
| launch_id | string | "00000017000003cd5a9bf01a" | Yes | Email, SMS, Push | Launch ID |
| send_message_id | string | "5a9bf01a17_3cd_11_6f_0_2.5a8c045fc1dde44cbf718f78" | Yes | Email, SMS, Push | Sent message ID |
| full_message_id | string | "fQIQs4FgAAEBIcARADkxODlKR8-gA" | Yes | Email, SMS, Push | Full SendMessageID |
| email_message_id | string | "mzi5c1~+9vqekqmy63mh8xhgt2qjwfkad6lmiafbyn-0te1_uzckfqyi4ry" | No | Email-safe SendMessageID | |
| extra_uid | string | "ew4Sgf41Qwjq8_2_2E_w_k___t.2SDvJv8bvBYQFtSDx_7bTV2f.2_2E_4Sgf41DXc7Z_D" | No | Push | Extra UID |
| provider | string | "YandexAppMetricaDeviceIDAndroid" | No | Push | Provider |
| prev_st | int | 1 | No | For all | Group identifier: 1 - test, 2 - control |
Messaging events
For the following event types:
- Email: send, deliv, suppress, complain
- SMS: send_sms, deliv_sms
- Push: send_push, deliv_push
| Parameter | Type | Example | Required | For which channel | Description |
|---|---|---|---|---|---|
| message_id | int | 17 | Yes | Email, SMS, Push | Message ID in the Altcraft system |
| campaign_id | int | 973 | Yes | Email, SMS, Push | Campaign ID in the Altcraft system |
| segment_id | int | 0 | No | Email, SMS, Push | Segment ID, if available |
| resource_id | int | 3 | Yes | Email, SMS, Push | Resource ID in the Altcraft system |
| launch_id | string | "00000017000003cd5a9bf01a" | Yes | Email, SMS, Push | Launch ID |
| send_message_id | string | "5a9bf01a17_3cd_11_6f_0_2.5a8c045fc1dde44cbf718f78" | Yes | Email, SMS, Push | Sent message ID |
| full_message_id | string | "fQIQs4FgAAEBIcARADkxODlKR8-gA" | Yes | Email, SMS, Push | Full SendMessageID |
| email_message_id | string | "mzi5c1~+9vqekqmy63mh8xhgt2qjwfkad6lmiafbyn-0te1_uzckfqyi4ry" | No | Email-safe SendMessageID | |
| extra_uid | string | "ew4Sgf41Qwjq8_2_2E_w_k___t.2SDvJv8bvBYQFtSDx_7bTV2f.2_2E_4Sgf41DXc7Z_D" | No | Push | Extra UID |
| provider | string | "YandexAppMetricaDeviceIDAndroid" | No | Push | Provider |
For events sbounce, hbounce, sbounce_push, hbounce_push, the following parameters are also passed:
| Parameter | Type | Example | Required | For which channel | Description |
|---|---|---|---|---|---|
| bounce_code | int | 500 | Yes | Email, Push | Server response code |
| bounce_message | string | "No such email" | Yes | Email, Push | Server response |
For events undeliv, undeliv_sms, undeliv_push, the following parameters are passed:
| Parameter | Type | Example | Required | For which channel | Description |
|---|---|---|---|---|---|
| undeliv_code | int | 400 | Yes | Email, SMS, Push | Error code |
| undeliv_message | string | "Invalid Caller ID" | Yes | Email, SMS, Push | Error message |
Pixel events
For pixel_open events:
| Parameter | Type | Example | Description |
|---|---|---|---|
| ip | string | "10.9.0.14" | Subscriber IPv4 address |
| country | string | ".ru " | Country in TLD format |
| city | string | "Moscow" | Subscriber city |
| pixel_id | int | 41 | Pixel ID |
| postal_code | string | "390000" | Subscriber postal code |
| region | string | "Ryazanskaya obl"ast | Subscriber region |
| tz | string | "Europe/Vaduz" | Subscriber time zone |
| lat | float | 55.244075 | Geographic latitude |
| lon | float | 55.244075 | Geographic longitude |
| user_agent | string | "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" | User-Agent header string |
| os | string | "Linux x86_64" | Operating system |
| browser | string | "Firefox" | Browser and version |
| device | string | "web" | Device |
All parameters described above are required. The full list of possible parameters is available in this article.
Popup events
For all popup_post, popup_click, popup_error, popup_bounce, popup_close, popup_open events:
| Parameter | Type | Example | Description |
|---|---|---|---|
| popup_id | int | 123 | Popup ID |
| referer | string | "api.example.com" | Referer request header |
| smid | string | "fGmXiWU9Y4NSIpCwl4QQQQEQEAABCRA" | Sent message identifier |
| utm_campaign | string | "utm_campaign" | Campaign UTM tag |
| utm_content | string | "utm_content" | Content UTM tag |
| utm_source | string | "utm_source" | Source UTM tag |
Some events have their own unique parameters:
| Parameter | Type | Example | Description | popup_post |
| post_uid | string | "7bc142b5-7f38-4272-bc7e-7539f70b25b1" | Unique form submission identifier | popup_click |
| name | string | "main_block" | Name of the element that was clicked |
| url | string | "example.com/page" | Value of the href attribute of the clicked element | popup_error, popup_bounce |
| error | string | "object_not_found" | Error text |
| error_category | int | 404 | Error number |
Promocode events
For promocode_attach, promocode_detach, promocode_activate events:
| Parameter | Type | Example | Description |
|---|---|---|---|
| attached | string | "2020-10-25T13:28:52Z" | Date and time the promocode was attached to the profile |
| detached | string | "2020-10-25T13:28:52Z" | Date and time the promocode was detached |
| activated | string | "2020-10-25T13:28:52Z" | Promocode activation date |
| code | string | "TEST-XOUH-KBJM-J5K9-24I1" | Promocode |
| db_id | int | 123456 | Profile database ID |
| loyalty_id | int | 9 | Loyalty program ID |
| profile_id | string | "000000000000000000000000" | Profile ID |
All dates are specified in RFC 3339 format.
Segment creation events during import
For segs_add, segs_remove events:
| Parameter | Type | Example | Description |
|---|---|---|---|
| campaign_id | int | 9 | Campaign ID in the Altcraft system |
| launch_id | string | "" | Campaign launch ID |
| message_id | int | 0 | Message ID in the Altcraft system |
| segment_id | int | 80 | Segment ID, if available |
| send_message_id | string | "" | Sent message ID |
| full_message_id | string | "fQIQs4FgAAEBIcARADkxODlKR8-gA" | Full SendMessageID |
Events of merging multiple profiles or splitting one profile
For profile_merge, profile_split events:
| Parameter | Type | Example | Description |
|---|---|---|---|
| destination | array | [ | If profile merging occurs, it contains the matching data of the profile that will result from the merge. If profile splitting occurs, it contains the matching data of the profiles that will result from the split. |
| source | array | [ | When profiles are merged, it contains matching data about the profiles that must be merged. When a profile is split, it contains matching data about the profile that must be split. |
Channel events
For events of the following channels:
- Telegram:
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 - MAX:
max_bot_send, max_bot_deliv, max_bot_click, max_bot_uclick, max_bot_undeliv, max_group_send, max_group_deliv, max_group_click, max_group_undeliv - WhatsApp:
whatsapp_deliv, whatsapp_undeliv, whatsapp_send, whatsapp_click, whatsapp_uclick, whatsapp_subscribe, whatsapp_read, whatsapp_unsub - Viber:
viber_deliv, viber_undeliv, viber_send, viber_click, viber_uclick, viber_subscribe, viber_read, viber_unsub, viber_complain - Notify:
notify_deliv, notify_undeliv, notify_send, notify_click, notify_uclick, notify_subscribe, notify_read, notify_unsub, notify_complain
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| campaign_id | int | 9 | Yes | Campaign ID in the Altcraft system |
| launch_id | string | "" | Yes | Campaign launch ID |
| message_id | int | 0 | Yes | Message ID in the Altcraft system |
| resource_id | int | 3 | No | Resource ID in the Altcraft system |
| segment_id | int | 80 | Yes | Segment ID, if available |
| send_message_id | string | "" | Yes | Sent message ID |
| full_message_id | string | "fQIQs4FgAAEBIcARADkxODlKR8-gA" | Yes | Full SendMessageID |
| city | string | "Moscow" | No | Subscriber city |
| browser | string | "Firefox" | No | Browser and version |
| country | string | ".ru" | No | Country in TLD format |
| device | string | "web" | No | Device |
| ip | string | "10.9.0.14" | No | Subscriber IPv4 address |
| lat | float | 55.244075 | No | Geographic latitude |
| link_url | string | "http://www.example.com" | No | HTTP link the user was redirected to |
| lon | float | 55.244075 | No | Geographic longitude |
| os | string | "Linux x86_64" | No | Operating system |
| postal_code | string | "390000" | No | Subscriber postal code |
| region | string | "Ryazanskaya oblast" | No | Subscriber region |
| tz | string | "Europe/Vaduz" | No | Subscriber time zone |
| undeliv_code | int | 500 | No | Delivery failure error code |
| undeliv_message | string | "Content is required" | No | Error information |
Campaign error events
For camp_error events:
| Parameter | Type | Example | Description |
|---|---|---|---|
| campaign_id | int | 9 | Campaign ID in the Altcraft system |
| error_code | int | 500 | Error code |
| error_text | string | "LOG_INTERNAL_ERROR" | Error text |
| launch_id | string | "" | Launch ID |
| message_id | int | 0 | Message ID in the Altcraft system |
| resource_id | int | 3 | Resource ID in the Altcraft system |
| segment_id | int | 80 | Segment ID, if available |
| send_message_id | string | "" | Sent message ID |
| full_message_id | string | "fQIQs4FgAAEBIcARADkxODlKR8-gA" | Full SendMessageID |
campaign_launch structure
General campaign_launch structure:
| Parameter | Type | Example | Description |
|---|---|---|---|
| event_type | string | "campaign_launch" | Event type |
| event_date | string | "2018-03-25T13:13:19.034315796Z" | Event date in RFC 3339 format |
| account_id | int | 23 | Platform account ID |
| is_test | bool | false | Test event sending flag |
| event_data | JSON object | {} | Object with campaign data |
event_data structure for campaign_launch
| Parameter | Type | Example | Description |
|---|---|---|---|
| campaign_id | int | 42 | Campaign identifier |
| campaign_type | string | "broadcast" | Campaign type |
| campaign_name | string | "name" | Campaign name |
| campaign_sub_id | string | "x11" | Statistics identifier |
| data_type | string | "segment" | Data source type |
| data_id | int | 3 | Data source identifier |
| launch_id | string | "00000017000003cd5a9bf01a" | Launch ID |
| content | JSON object | {} | Information about campaign message templates |
Campaign launch event 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": "текстовая версия письма",
"html": "<html> html версия письма </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": "текстовая версия письма",
"html": "<html> html версия письма </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}!"
}
]
}
}
Subscription structure
This object contains information about the subscription to the resource through which the message was sent:
| Parameter | Type | Example | Description | Common for all channels |
| resource_id | int | 12 | Resource ID |
| channel | string | "email" | Communication channel |
| priority | int | 0 | Subscription priority |
| status | string | "subscribed" | Subscription status | For the email channel |
| string | "john@example.com" | Subscriber email | For the SMS channel |
| post_uid | string | "+79991112233" | Subscriber phone number | For the push channel |
| provider | string | "YandexAppMetricaDeviceIDAndroid" | Push provider |
| subscription_id | string | "123ab667960efec47b1afe64b56bfa386a3" | Provider subscription ID |
content structure
If the "Add messages content" option is enabled in the webhook settings, the content field is added to the general hook message structure.
Email
{
"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"
},
}
| Parameter | Type | Example | Description |
|---|---|---|---|
| amp | string | AMP version of the email | |
| from_email | string | "no-reply@altcraft.com" | Sender email |
| from_name | string | "Altcraft" | Sender name |
| html | string | HTML version of the email | |
| replyto_email | string | "example@example.com" | Reply-to email |
| replyto_name | string | "Altcraft" | Reply-to name |
| subject | string | "Weather alert" | Email subject |
| text | string | "Text version is important..." | Text version of the email |
| to_email | string | "profile@example.com" | Recipient profile email address |
| to_name | string | "Fname Lname " | Recipient profile name |
| webversion_email_html | string | http://click.altkraft.com | Link to the web version of the email |
| webversion_email_text | string | http://click.altkraft.com | Link to the text web version of the email |
SMS
{
"content": {
"fromnamesms": "abcdefghijklmnqrstuvwxyz",
"sms": "Hello, Aaron! See the new items for you: http://click.altkraft.com/s/path",
"webversion_sms_text": "http://click.altkraft.com/000000/path.txt"
}
}
| Parameter | Type | Example | Description |
|---|---|---|---|
| fromnamesms | string | "abcdefghijklmnqrstuvwxyz" | Caller ID |
| sms | string | "Follow the link and claim your welcome bonus!" | Message text |
| webversion_sms_text | string | http://click.altkraft.com | Link to the web version of the message |
Push
{
"content": {
"app_push_settings": {
"background_color": "#00CED1",
"badges": 0,
"banner": "",
"critical_push": false,
"deliver_prior": 0,
"expir_time": 604800,
"led": "",
"media": "",
"silent_push": false,
"sound": "",
"subtitle": "",
"vibro": false
},
"body": "See if our new items are fit to make you even more awesome!",
"click_url": "https://click.altkraft.com/0000000",
"custom_push_json": {},
"icon": "",
"result_content": {
"content_available": true,
"data": {
"hub_link": {
"ack": "https://pxl.altkraft.com/crypto_post_events?/bFOoNcxW7lpDA",
"open": "https://pxl.altkraft.com/crypto_post_events?/LbFOoNcxW7lpDA"
},
"image": "",
"launch_id": "2_3J_4Z2ZTRaQr7p",
"mediaUrl": "",
"message": "See if our new items are fit to make you even more awesome!",
"uid": "fATFSGbgLjinkRE59ZXDOSd0BcAABARnhIxDBBAAAEbAQowRH"
},
"mutable_content": true,
"notification": {
"body": "See if our new items are fit to make you even more awesome!",
"click_action": "https://click.altkraft.com/0000000/abcdefghijklmnqrstuvwxyz",
"color": "",
"icon": "",
"sound": "default"
},
"title": "Just look, Alex! These are awesome!",
"priority": "normal",
"time_to_live": 604800,
"to": "5dbDUxVXHV"
},
"title": "Just look, Alex! These are awesome!",
"webversion_push_body": "http://click.altkraft.com/000000/path.txt"
}
}
| Parameter | Type | Description |
|---|---|---|
| body | string | Push message body |
| click_url | string | Click-through link |
| custom_push_json | JSON object | Custom JSON of the message |
| icon | string | Path to the push message icon |
| title | string | Message title |
| result_content | JSON object | Stores the structure of data sent to the push service |
| webversion_push_body | string | Link to the web version of the push message |
| app_push_settings | JSON object | Advanced settings for mobile push notifications |
| web_push_settings | JSON object | Advanced settings for browser push notifications |
app_push_settings structure
| Parameter | Type | Example | Description |
|---|---|---|---|
| background_color | string | #00CED1 | Push notification background color |
| badges | int | 0 | Event indicator |
| banner | string | http://example.com/path.img" | Path to the banner image |
| critical_push | bool | false | Enables critical mode in the push notification |
| deliver_prior | int | 0,1 | Delivery priority |
| expir_time | int | 604800 | Push notification TTL in seconds |
| led | string | #00CED2 | LED indicator color |
| media | string | http://example.com/path | Path to a local file in the application |
| silent_push | bool | false | Enables or disables silent mode |
| sound | string | /sound/sound.mp3 | Path to a local file in the application |
| subtitle | string | "Just for you!" | Message subtitle (for iOS) |
| vibro | bool | true | Vibration when the push notification is received |
| soundless | bool | true | Indicates whether the push message will be accompanied by sound (used by providers: android firebase, android huawei, android rustore) |
| actions | array | [ | Buttons in push notifications |
web_push_settings structure
| Parameter | Type | Example | Description |
|---|---|---|---|
| actions | JSON object | [] | The array contains push buttons: click-through link (action) + button text (label) |
| button_label | string | "Sure" | Action button text (the value is passed only for the Safari provider) |
| large_image | string | "https://.altkraft.com/284834790/1/664c6da207767c769a/image.png" | Path to the banner image |
| expir_time | string | 604800 | Push notification TTL in seconds |
| large_image | string | "https://click.example.com" | Path to the local banner image |
**Meta, which owns Instagram, Facebook, and WhatsApp, has been recognized as an extremist organization and banned in the Russian Federation.*
**Viber is a trademark of Rakuten Group, Inc. Blocked in the Russian Federation.