Skip to main content

Get Message Settings

This endpoint allows to get information about message content templates for different languages and communication channels, expiration information, greeting settings and other settings.

Request

POST <API base url>/settings/{id}

URL query parameters

NameTypeRequiredDescription
idint64yesSettings unique identifier

Response

On success:

{
"reference": optional string, // Reference to an external entity
"delivery": optional {
"expiresAt": optional string // Expiration UTC timestamp in ISO format.
// After that value message must not be sent.
},
"content": required { // Dictionary of content templates grouped by
"en": { // two letter language code (ISO 639-1)
"generalGreeting": optional string,
"personalGreeting": optional string,
"messenger": optional {
"text": optional string,
"image": optional string,
"buttonText": optional string,
"buttonUrl": optional string
},
"sms": optional {
"text": required string
},
"inApp": optional {
"name": optional string,
"description": optional string,
"image": optional string,
"buttonText": optional string,
"buttonUrl": optional string,
"notification": optional {
"title": required string,
"body": required string,
}
},
"email": optional {
"subject": required string,
"body": required string
}
},
"de": {
...
},
}
}

Example:

{
"reference":"b776cecf-658a-4721-89fd-11b54907e095",
"delivery":{
"expiresAt":"2021-12-31T00:00:00Z"
},
"content":{
"en":{
"generalGreeting": "Dear customer!",
"personalGreeting": "Hello, {customer.name}!",
"messenger":{
"text":"Guaranteed cashback for all purchases in stores and online!\n\n1% Bonuses for ALL purchases made online and via paymant terminal with DemoBank card.",
"image":"https://cdn.s1mpl.com/img/IO",
"buttonText":"Details",
"buttonUrl":"https://t.s1mpl.com/c/{tid}/CX"
},
"sms":{
"text":"Guaranteed cashback for all purchases in stores and online! Details: https://t.s1mpl.com/c/{tid}/CX"
}
}
}
}

Variables Handling

All values in content fields for each language could contain placeholders for variable values (image url, name, text, etc.). Placeholders are marked with curly braces, for example {someVar}. Before sending a message to particular customer all placeholders must be replaced by corresponding variable values defined in message for that customer. There are several types of variables:

  • variables defined in variables field of a message
  • special variable customer.name - this variable must be evaluated on the client (issuer) side, by performing customer details lookup using customer identifier specified in a message. The value of this variable should be information about how the client prefers to be called upon contact, for example John, Mr. Edwards, etc.
  • special variable greeting - used to generate greeting phrase

Each placeholder must be replaced by a value using the following rules in the defined order:

  1. Lookup value in the variables field of the message by placeholder name (text between curly braces)
  2. If the placeholder name is customer.name, then perform customer details lookup using to.id field of a message to get a value for the placeholder replacement
  3. If the placeholder name is greeting, then get the value as for customer.name:
  • if customer.name and personalGreeting are defined then use personalGreeting for the placeholder replacement. This value could contain {customer.name} placeholder, if so replace it with customer.name value.
  • if customer.name is not defined and generalGreeting is defined then use personalGreeting for the placeholder replacement
  1. If no value found for the placeholder then report error status for a message mentioning in details what placeholder was not found (it is required to report all placeholder names without corresponding variable values in a single event).