Templates

A template resource represents the specific implementation of a template for a given communication type, organization, language and channel


Parameters

Name In Type Required Description
org path string true Organization name as it is registered in Mas-Stack
type query string false Communication type. Allows EQ (type=password_reset), and CONTAINS (type[contains]=password) operations
channel query string false Template channel
language query string false Template language
subject query string false Subject for email templates
content query string false Search template by partial content
limit query integer(int64) false Limit of results in the response
offset query integer(int64) false Offset applied to results for pagination

Request example

1
2
3
4
5

curl -X GET https://communications.masstack.com/v2/orgs/yoigo/templates?type='password_reset'&channel='sms'&language='en'&subject='Shippingintransit'&content='shippingisintransit'&limit='20'&offset='0' \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Responses

Code Meaning Description Schema
200 OK SMS templates successful search TemplatesResponseDto
400 Bad Request Client error ResponseErrorDto
500 Internal Server Error Server error ResponseErrorDto

Parameters

Name In Type Required Description
org path string true Organization name as it is registered in Mas-Stack
body body TemplateRequestDto true Template values

Request body - instance of TemplateRequestDto

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "type": "password_reset",
  "language": "en",
  "channel": "sms",
  "data": {
    "senderInfo": "YOIGO",
    "content": "SGkgWygke25hbWV9KV0sIGVudGVyIFsoJHtyZXNldExpbmt9KV0gdG8gcmVzZXQgcGFzc3dvcmQ="
  },
  "arguments": {
    "name": "Juan",
    "subscriptions": [
      "ftth",
      "mobile",
      "health"
    ],
    "resetLink": "https://password.com/reset/123456",
    "birthDate": "2022-04-25 12:00:00",
    "vipClient": false,
    "balance": 45.7,
    "birthCountry": "US",
    "attached.txt": "SG9sYSBQYWJsbyA6KQo=",
    "embedded_image_png": "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
    "qrArgument": "Text to convert into QR Code"
  }
}
Name Type Required Description
type string true Communication type code according to the ones previously defined in the system
language string true Template language
channel string true Template channel
data TemplateRequestData true Data required for the template definition. It is different depending on the channel
arguments object false Parameters and assigned values that are required to render the specified template. Depending on the argument type they can be a string, a number, a boolean or an array. This field is only required when previewing templates
» additionalProperties object false Parameters and assigned values that are required to render the specified template. Depending on the argument type they can be a string, a number, a boolean or an array. This field is only required when previewing templates

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

curl -X PUT https://communications.masstack.com/v2/orgs/yoigo/templates \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'type': 'password_reset',
  'language': 'en',
  'channel': 'sms',
  'data': {
    'senderInfo': 'YOIGO',
    'content': 'SGkgWygke25hbWV9KV0sIGVudGVyIFsoJHtyZXNldExpbmt9KV0gdG8gcmVzZXQgcGFzc3dvcmQ='
  },
  'arguments': {
    'name': 'Juan',
    'subscriptions': [
      'ftth',
      'mobile',
      'health'
    ],
    'resetLink': 'https://password.com/reset/123456',
    'birthDate': '2022-04-25 12:00:00',
    'vipClient': false,
    'balance': 45.7,
    'birthCountry': 'US',
    'attached.txt': 'SG9sYSBQYWJsbyA6KQo=',
    'embedded_image_png': 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==',
    'qrArgument': 'Text to convert into QR Code'
  }
}" 

Responses

Code Meaning Description Schema
200 OK Communication template successfully updated TemplateResponseDto
400 Bad Request Client error ResponseErrorDto
500 Internal Server Error Server Error ResponseErrorDto

Parameters

Name In Type Required Description
org path string true Organization name as it is registered in Mas-Stack
body body TemplateRequestDto true Template values

Request body - instance of TemplateRequestDto

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "type": "password_reset",
  "language": "en",
  "channel": "sms",
  "data": {
    "senderInfo": "YOIGO",
    "content": "SGkgWygke25hbWV9KV0sIGVudGVyIFsoJHtyZXNldExpbmt9KV0gdG8gcmVzZXQgcGFzc3dvcmQ="
  },
  "arguments": {
    "name": "Juan",
    "subscriptions": [
      "ftth",
      "mobile",
      "health"
    ],
    "resetLink": "https://password.com/reset/123456",
    "birthDate": "2022-04-25 12:00:00",
    "vipClient": false,
    "balance": 45.7,
    "birthCountry": "US",
    "attached.txt": "SG9sYSBQYWJsbyA6KQo=",
    "embedded_image_png": "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
    "qrArgument": "Text to convert into QR Code"
  }
}
Name Type Required Description
type string true Communication type code according to the ones previously defined in the system
language string true Template language
channel string true Template channel
data TemplateRequestData true Data required for the template definition. It is different depending on the channel
arguments object false Parameters and assigned values that are required to render the specified template. Depending on the argument type they can be a string, a number, a boolean or an array. This field is only required when previewing templates
» additionalProperties object false Parameters and assigned values that are required to render the specified template. Depending on the argument type they can be a string, a number, a boolean or an array. This field is only required when previewing templates

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

curl -X POST https://communications.masstack.com/v2/orgs/yoigo/templates \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'type': 'password_reset',
  'language': 'en',
  'channel': 'sms',
  'data': {
    'senderInfo': 'YOIGO',
    'content': 'SGkgWygke25hbWV9KV0sIGVudGVyIFsoJHtyZXNldExpbmt9KV0gdG8gcmVzZXQgcGFzc3dvcmQ='
  },
  'arguments': {
    'name': 'Juan',
    'subscriptions': [
      'ftth',
      'mobile',
      'health'
    ],
    'resetLink': 'https://password.com/reset/123456',
    'birthDate': '2022-04-25 12:00:00',
    'vipClient': false,
    'balance': 45.7,
    'birthCountry': 'US',
    'attached.txt': 'SG9sYSBQYWJsbyA6KQo=',
    'embedded_image_png': 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==',
    'qrArgument': 'Text to convert into QR Code'
  }
}" 

Responses

Code Meaning Description Schema
202 Accepted Communication template successfully created TemplateResponseDto
400 Bad Request Client error ResponseErrorDto
500 Internal Server Error Server Error ResponseErrorDto

Parameters

Name In Type Required Description
org path string true Organization name as it is registered in Mas-Stack
type query string true Communication type
channel query string true Template channel
language query string true Template language

Request example

1
2
3
4
5

curl -X DELETE https://communications.masstack.com/v2/orgs/yoigo/templates?type='password_reset'&channel='sms'&language='en'?type=password_reset&channel=sms&language=en \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Responses

Code Meaning Description Schema
200 OK Template successfully deleted TemplateResponseDto
400 Bad Request Client error ResponseErrorDto
404 Not Found Template not found ResponseErrorDto
500 Internal Server Error Server error ResponseErrorDto

Parameters

Name In Type Required Description
org path string true Organization name as it is registered in Mas-Stack
body body TemplateRequestDto true Template values

Request body - instance of TemplateRequestDto

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "type": "password_reset",
  "language": "en",
  "channel": "sms",
  "data": {
    "senderInfo": "YOIGO",
    "content": "SGkgWygke25hbWV9KV0sIGVudGVyIFsoJHtyZXNldExpbmt9KV0gdG8gcmVzZXQgcGFzc3dvcmQ="
  },
  "arguments": {
    "name": "Juan",
    "subscriptions": [
      "ftth",
      "mobile",
      "health"
    ],
    "resetLink": "https://password.com/reset/123456",
    "birthDate": "2022-04-25 12:00:00",
    "vipClient": false,
    "balance": 45.7,
    "birthCountry": "US",
    "attached.txt": "SG9sYSBQYWJsbyA6KQo=",
    "embedded_image_png": "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
    "qrArgument": "Text to convert into QR Code"
  }
}
Name Type Required Description
type string true Communication type code according to the ones previously defined in the system
language string true Template language
channel string true Template channel
data TemplateRequestData true Data required for the template definition. It is different depending on the channel
arguments object false Parameters and assigned values that are required to render the specified template. Depending on the argument type they can be a string, a number, a boolean or an array. This field is only required when previewing templates
» additionalProperties object false Parameters and assigned values that are required to render the specified template. Depending on the argument type they can be a string, a number, a boolean or an array. This field is only required when previewing templates

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

curl -X POST https://communications.masstack.com/v2/orgs/yoigo/templates/preview \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'type': 'password_reset',
  'language': 'en',
  'channel': 'sms',
  'data': {
    'senderInfo': 'YOIGO',
    'content': 'SGkgWygke25hbWV9KV0sIGVudGVyIFsoJHtyZXNldExpbmt9KV0gdG8gcmVzZXQgcGFzc3dvcmQ='
  },
  'arguments': {
    'name': 'Juan',
    'subscriptions': [
      'ftth',
      'mobile',
      'health'
    ],
    'resetLink': 'https://password.com/reset/123456',
    'birthDate': '2022-04-25 12:00:00',
    'vipClient': false,
    'balance': 45.7,
    'birthCountry': 'US',
    'attached.txt': 'SG9sYSBQYWJsbyA6KQo=',
    'embedded_image_png': 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==',
    'qrArgument': 'Text to convert into QR Code'
  }
}" 

Responses

Code Meaning Description Schema
200 OK Template processed successfully TemplateResponseDto
400 Bad Request Client error ResponseErrorDto
500 Internal Server Error Server Error ResponseErrorDto

Parameters

Name In Type Required Description
org path string true Organization name as it is registered in Mas-Stack
body body TemplateRequestDto true Template values

Request body - instance of TemplateRequestDto

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "type": "password_reset",
  "language": "en",
  "channel": "sms",
  "data": {
    "senderInfo": "YOIGO",
    "content": "SGkgWygke25hbWV9KV0sIGVudGVyIFsoJHtyZXNldExpbmt9KV0gdG8gcmVzZXQgcGFzc3dvcmQ="
  },
  "arguments": {
    "name": "Juan",
    "subscriptions": [
      "ftth",
      "mobile",
      "health"
    ],
    "resetLink": "https://password.com/reset/123456",
    "birthDate": "2022-04-25 12:00:00",
    "vipClient": false,
    "balance": 45.7,
    "birthCountry": "US",
    "attached.txt": "SG9sYSBQYWJsbyA6KQo=",
    "embedded_image_png": "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
    "qrArgument": "Text to convert into QR Code"
  }
}
Name Type Required Description
type string true Communication type code according to the ones previously defined in the system
language string true Template language
channel string true Template channel
data TemplateRequestData true Data required for the template definition. It is different depending on the channel
arguments object false Parameters and assigned values that are required to render the specified template. Depending on the argument type they can be a string, a number, a boolean or an array. This field is only required when previewing templates
» additionalProperties object false Parameters and assigned values that are required to render the specified template. Depending on the argument type they can be a string, a number, a boolean or an array. This field is only required when previewing templates

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

curl -X POST https://communications.masstack.com/v2/orgs/yoigo/templates/preview/validate \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'type': 'password_reset',
  'language': 'en',
  'channel': 'sms',
  'data': {
    'senderInfo': 'YOIGO',
    'content': 'SGkgWygke25hbWV9KV0sIGVudGVyIFsoJHtyZXNldExpbmt9KV0gdG8gcmVzZXQgcGFzc3dvcmQ='
  },
  'arguments': {
    'name': 'Juan',
    'subscriptions': [
      'ftth',
      'mobile',
      'health'
    ],
    'resetLink': 'https://password.com/reset/123456',
    'birthDate': '2022-04-25 12:00:00',
    'vipClient': false,
    'balance': 45.7,
    'birthCountry': 'US',
    'attached.txt': 'SG9sYSBQYWJsbyA6KQo=',
    'embedded_image_png': 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==',
    'qrArgument': 'Text to convert into QR Code'
  }
}" 

Responses

Code Meaning Description Schema
202 Accepted Template validated successfully TemplateValidationResponse
400 Bad Request Client error ResponseErrorDto
500 Internal Server Error Server Error ResponseErrorDto

Parameters

Name In Type Required Description
org path string true Organization name as it is registered in Mas-Stack
body body TemplateValidateRequestDto true Template filters

Request body - instance of TemplateValidateRequestDto

1
2
3
4
5
{
  "type": "password_reset",
  "language": "en",
  "channel": "sms"
}
Name Type Required Description
type string true Communication type code according to the ones previously defined in the system
language string true Template’s language (ISO 639-1)
channel string true Template’s channel

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

curl -X POST https://communications.masstack.com/v2/orgs/yoigo/templates/validate \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'type': 'password_reset',
  'language': 'en',
  'channel': 'sms'
}" 

Responses

Code Meaning Description Schema
202 Accepted Template validated successfully TemplateValidationResponse
400 Bad Request Client error ResponseErrorDto
404 Not Found Template not found ResponseErrorDto
500 Internal Server Error Server Error ResponseErrorDto

Endpoints

CMS

    Communications

      Short URLs

        Communication Types

          Examples

            Templates