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
| Name | Type | Required | Description |
|---|---|---|---|
| id | int64 | yes | Settings 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
variablesfield 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 exampleJohn,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:
- Lookup value in the
variablesfield of the message by placeholder name (text between curly braces) - If the placeholder name is
customer.name, then perform customer details lookup usingto.idfield of a message to get a value for the placeholder replacement - If the placeholder name is
greeting, then get the value as forcustomer.name:
- if
customer.nameandpersonalGreetingare defined then usepersonalGreetingfor the placeholder replacement. This value could contain{customer.name}placeholder, if so replace it withcustomer.namevalue. - if
customer.nameis not defined andgeneralGreetingis defined then usepersonalGreetingfor the placeholder replacement
- If no value found for the placeholder then report
errorstatus for a message mentioning indetailswhat placeholder was not found (it is required to report all placeholder names without corresponding variable values in a single event).