Examples

An example resource represents the expected communication data given a template (defined by its type, organization, language and channel) and some specific input arguments


Parameters

Name In Type Required Description
org path string true Organization name as it is registered in Mas-Stack
exampleId path string true The example Id

Request example

1
2
3
4
5

curl -X GET https://communications.masstack.com/v2/orgs/yoigo/examples/c8036149-f8e4-442e-8e98-90fd3a6ec352 \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Responses

Code Meaning Description Schema
202 Accepted Example found and returned ExampleResponse
404 Not Found Example 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
exampleId path string true The example Id
body body ExampleRequestDto true Request body to create an example in JSON format

Request body - instance of ExampleRequestDto

 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
{
  "id": "30387cbc-e3da-4c2a-be92-8aad3438908a",
  "type": "password_reset",
  "language": "en",
  "channel": "sms",
  "requestRef": "https://jiranext.masmovil.com/browse/CUCO-817",
  "description": "Mobile subscription contract sending",
  "expectedOutput": {
    "senderInfo": "MasMovil",
    "content": "Bienvenido a MasMovil!"
  },
  "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"
  }
}
Name Type Required Description
id string(uuid) false UUID to be used as identifier of the example. It must be unique in the system
type string true Communication type code according to the ones previously defined in the system
language string true Example’s language(ISO 639-1)
channel string true Channel of example
requestRef string false Reference of issue where example was requested
description string false Comprehensive description of the purpose of the example
expectedOutput object true Expected output required for the example definition. It is different depending on the channel
arguments object false Input arguments used in the example. Name and value of arguments must be coherent with registered type’s arguments.
» additionalProperties object false Input arguments used in the example. Name and value of arguments must be coherent with registered type’s arguments.

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/examples/c8036149-f8e4-442e-8e98-90fd3a6ec352 \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'id': '30387cbc-e3da-4c2a-be92-8aad3438908a',
  'type': 'password_reset',
  'language': 'en',
  'channel': 'sms',
  'requestRef': 'https://jiranext.masmovil.com/browse/CUCO-817',
  'description': 'Mobile subscription contract sending',
  'expectedOutput': {
    'senderInfo': 'MasMovil',
    'content': 'Bienvenido a MasMovil!'
  },
  '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'
  }
}" 

Responses

Code Meaning Description Schema
200 OK Communication example successfully updated ExampleResponse
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
exampleId path string true The example Id

Request example

1
2
3
4
5

curl -X DELETE https://communications.masstack.com/v2/orgs/yoigo/examples/c8036149-f8e4-442e-8e98-90fd3a6ec352 \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Responses

Code Meaning Description Schema
200 OK Deleted example ExampleResponse
404 Not Found Example 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
type query string false Communication type. Allows EQ (type=password_reset), and CONTAINS (type[contains]=password) operations
language query string false Template language
channel query string false Template channel
description query string false Example description. Allows EQ (description=Shipping in transit), and CONTAINS (description[contains]=shipping) operations
requestRef query string false Example request reference. Allows EQ (requestRef=https://jira.com/CUCO-123), and CONTAINS (requestRef[contains]=CUCO-123) operations
subject query string false Email example expected subject. Allows EQ (subject=Welcome to masmovil), and CONTAINS (subject[contains]=Welcome) operations
content query string false Expected content for example. Allows EQ (content=Your portability is done), and CONTAINS (content[contains]=portability) operations
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/examples?type='password_reset'&language='en'&channel='sms'&description='Shippingintransit'&requestRef='https://jira.com/CUCO-123'&subject='Welcometomasmovil'&content='Yourportabilityisdone'&limit='20'&offset='0' \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Responses

Code Meaning Description Schema
202 Accepted Found examples ExampleListResponse
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 ExampleRequestDto true Request body to create an example in JSON format

Request body - instance of ExampleRequestDto

 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
{
  "id": "30387cbc-e3da-4c2a-be92-8aad3438908a",
  "type": "password_reset",
  "language": "en",
  "channel": "sms",
  "requestRef": "https://jiranext.masmovil.com/browse/CUCO-817",
  "description": "Mobile subscription contract sending",
  "expectedOutput": {
    "senderInfo": "MasMovil",
    "content": "Bienvenido a MasMovil!"
  },
  "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"
  }
}
Name Type Required Description
id string(uuid) false UUID to be used as identifier of the example. It must be unique in the system
type string true Communication type code according to the ones previously defined in the system
language string true Example’s language(ISO 639-1)
channel string true Channel of example
requestRef string false Reference of issue where example was requested
description string false Comprehensive description of the purpose of the example
expectedOutput object true Expected output required for the example definition. It is different depending on the channel
arguments object false Input arguments used in the example. Name and value of arguments must be coherent with registered type’s arguments.
» additionalProperties object false Input arguments used in the example. Name and value of arguments must be coherent with registered type’s arguments.

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/examples \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'id': '30387cbc-e3da-4c2a-be92-8aad3438908a',
  'type': 'password_reset',
  'language': 'en',
  'channel': 'sms',
  'requestRef': 'https://jiranext.masmovil.com/browse/CUCO-817',
  'description': 'Mobile subscription contract sending',
  'expectedOutput': {
    'senderInfo': 'MasMovil',
    'content': 'Bienvenido a MasMovil!'
  },
  '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'
  }
}" 

Responses

Code Meaning Description Schema
202 Accepted Communication example successfully created ExampleResponse
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
exampleId path string true The example Id

Request example

1
2
3
4
5

curl -X POST https://communications.masstack.com/v2/orgs/yoigo/examples/c8036149-f8e4-442e-8e98-90fd3a6ec352/validate \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Responses

Code Meaning Description Schema
200 OK Example validated successfully ExampleValidationResponse
400 Bad Request Client error ResponseErrorDto
404 Not Found Example not found ResponseErrorDto
500 Internal Server Error Server Error ResponseErrorDto

Endpoints

CMS

    Communications

      Short URLs

        Communication Types

          Examples

            Templates