Example#
It creates an SMS message which will be sent at given time to members of given audience:
{
"name": "My message", "shorten_urls": true, "track_in_shortener": true, "campaign_id" : 32,
"channels": [
{
"type": "sms",
"sender": { "type": "alphanumeric", "value": "Infinity" },
"template": {
"type": "inline",
"data": { "type": "plain", "content": { "body": "Hi {{name}}" } }
}
}
],
"sending": {
"schedule": { "type": "absolute", "at": "2020-10-18T10:59:32.340Z" },
"audience": { "type": "reference", "id" : 15 }
}
}
Definition#
Key | Type | Description |
---|
name | string | |
shorten_urls | boolean | Should sendings for this message have URLs shortened? Default: true |
shorten_urls | boolean | Should MPC's Shortener track users? Default: false |
campaign_id | integer | MPC's Campaign ID |
channels | ChannelPayload[] | Channels the message should be sent with. |
sending | SendingPayload | Sending to schedule for the message, available only on creation |
Specific Validation Errors#
Attribute | Error key | Description |
---|
campaign_id | is_relevant_only_for_campaign_service | When campaign_id is given and service is not "campaigns" |
channels | types_must_be_unique | |
channels[].type | not_configured | Channel is not configured for Loyalty Club - see Messaging > Settings |
ChannelPayload model#
Example#
{
"type": "sms",
"sender": { "type": "alphanumeric", "value": "Infinity" },
"template": {
"type": "inline",
"data": { "type": "plain", "content": { "body": "Hi {{first_name}}" } }
}
}
Definition#
Key | Type | Description |
---|
type | enum: ['sms', 'email', 'push'] | |
template.type | enum: ['inline', 'reference'] | |
template.id | integer | ID of Template to assign (when reference ) |
template.definition | MessageTemplatePayload | Definition of Template to assign (when inline ) |
(channel-specific attributes) | | |
There are two ways to provide template:inline
- you will need provide new template definition
reference
- template definition will be copied from template identified by id
Specific Validation Errors#
Attribute | Error key |
---|
template.id | template_does_not_exist |
template.id | template_does_not_match_channel |
template.definition.type | template_does_not_match_channel |
template.definition.wrapper_id | template_does_not_match_channel |
MessageTemplatePayload model#
Example#
{
"type": "plain",
"wrapper_id": 9193,
"content": { "body": "Hi {{first_name}}" }
}
Definition#
Key | Type | Description |
---|
type | enum: ['plain', 'email', 'bee_email', 'push'] | |
content | Object | Depends on type. See: Template model |
wrapper_id | integer | ID of wrapping template |
Specific Validation Errors#
Attribute | Error key |
---|
wrapper_id | template_does_not_exist |
wrapper_id | wrapper_type_does_not_match |
Modified at 2024-04-22 22:18:17