Templates Beta

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
changeType query string false Templates changeType. Values can be ‘draft’, ‘stable’, ‘archived’ or ‘deleted’.Defaults is stable.

Request example

1
2
3
4
5

curl -X GET https://communications.masstack.com/v2/beta/orgs/yoigo/templates?type='password_reset'&channel='sms'&language='en'&subject='Shippingintransit'&content='shippingisintransit'&limit='20'&offset='0'&changeType='stable' \
  -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
26
{
  "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"
  },
  "requestRef": "https://jiranext.masmovil.com/browse/CUCO-817"
}
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
requestRef string false Reference of issue where example was requested

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
32

curl -X PUT https://communications.masstack.com/v2/beta/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'
  },
  'requestRef': 'https://jiranext.masmovil.com/browse/CUCO-817'
}" 

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
26
{
  "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"
  },
  "requestRef": "https://jiranext.masmovil.com/browse/CUCO-817"
}
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
requestRef string false Reference of issue where example was requested

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
32

curl -X POST https://communications.masstack.com/v2/beta/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'
  },
  'requestRef': 'https://jiranext.masmovil.com/browse/CUCO-817'
}" 

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
changeType query string false Example changeType. Values can be ‘draft’.Defaults to including ‘stable’ and ‘draft’.

Request example

1
2
3
4
5

curl -X DELETE https://communications.masstack.com/v2/beta/orgs/yoigo/templates?type='password_reset'&channel='sms'&language='en'&changeType='draft'?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 TemplateDeploymentPackageDownloadDto true Deployment selection for the export package. Allows cherry-picking specific objects to include in the deployment.

Request body - instance of TemplateDeploymentPackageDownloadDto

1
2
3
4
5
6
7
8
{
  "download": [
    {
      "objectId": "d5b5c973-3194-49b6-96f4-508167f05506",
      "objectType": "sms_example"
    }
  ]
}
Name Type Required Description
download [DownloadItemDto] false List of objects to download for the deployment package

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14

curl -X POST https://communications.masstack.com/v2/beta/orgs/yoigo/templates/download \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'download': [
    {
      'objectId': 'd5b5c973-3194-49b6-96f4-508167f05506',
      'objectType': 'sms_example'
    }
  ]
}" 

Responses

Code Meaning Description Schema
200 OK Returns a JSON deployment package as an attachment. DeploymentPackageDto
400 Bad Request Client error ResponseErrorDto
404 Not Found deployment package 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 FileUploadInputDto true Deployment package JSON file

Request body - Content-Type: multipart/form-data

Custom schema example

1
2
file: string

Name Type Required Description
file string true Deployment package JSON file

Request example

1
2
3
4
5
6
7

curl -X POST https://communications.masstack.com/v2/beta/orgs/yoigo/templates/import \
  -H "Content-Type: multipart/form-data" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
  -F "file=undefined" \

Responses

Code Meaning Description Schema
200 OK Deployment package imported successfully DeploymentImportResultDto
400 Bad Request Invalid deployment package or duplicate version 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
26
{
  "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"
  },
  "requestRef": "https://jiranext.masmovil.com/browse/CUCO-817"
}
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
requestRef string false Reference of issue where example was requested

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
32

curl -X POST https://communications.masstack.com/v2/beta/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'
  },
  'requestRef': 'https://jiranext.masmovil.com/browse/CUCO-817'
}" 

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
26
{
  "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"
  },
  "requestRef": "https://jiranext.masmovil.com/browse/CUCO-817"
}
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
requestRef string false Reference of issue where example was requested

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
32

curl -X POST https://communications.masstack.com/v2/beta/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'
  },
  'requestRef': 'https://jiranext.masmovil.com/browse/CUCO-817'
}" 

Responses

Code Meaning Description Schema
202 Accepted Template validated successfully TemplateValidationV2Response
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
6
{
  "type": "password_reset",
  "language": "en",
  "channel": "sms",
  "changeType": "draft"
}
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
changeType string false Change type of template, default is stable. Valid values: stable, draft.

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12

curl -X POST https://communications.masstack.com/v2/beta/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',
  'changeType': 'draft'
}" 

Responses

Code Meaning Description Schema
202 Accepted Template validated successfully TemplateValidationV2Response
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

              Communication Types Beta

                Examples Beta

                  Templates Beta

                    Templates Commit Beta