Read / Get Templates
Want to get a Template by its name?
Just as the heading itself indicates you just have to enter the name of the required template to get it.
Note: This is an example getting a template by its name (
test_template
)
Get Template by Name
API call to get a Template.
Organization ID
GET /v1.1/org/{orgId}/templates/test_template HTTP/1.1
Host: www.channel360.co.za
Accept: */*
Successfully retrieved Template
{
"tags": {
"head": {
"index": 1,
"type": "hard-coded",
"value": "TAG"
},
"body": [
{
"index": 1,
"type": "hard-coded",
"value": "TAG"
},
{
"index": 2,
"type": "hard-coded",
"value": "TAG"
}
]
},
"organization": "344540b058c0ad640439fd0",
"name": "test_template",
"description": "auto-ingested - tag configuration required",
"namespace": "",
"language": "en_US",
"category": "MARKETING",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "This is some example {{1}} text",
"buttons": []
},
{
"type": "BODY",
"text": "hardcoded: {{1}} subscriber-field: {{2}} appanrently this needs to be longer",
"buttons": []
}
],
"status": "REJECTED",
"enabled": false,
"messageTemplateId": "3392719194307567",
"version": 0,
"id": "3452de4d79ue01d929e001df"
}
Get Template with image in header
Just as the Template before this works exactly the same, but the twist with this template is that it has an image in its header.
Get Template by Name (with image in header)
API call to get a Template with image in the header
GET /v1.1/org/{orgId}/templates/{templateName} HTTP/1.1
Host: www.channel360.co.za
Accept: */*
Successfully retrieved Template (with image in the header)
{
"tags": {
"head": [
{
"type": "image",
"url": "https://media.newyorker.com/photos/59095bb86552fa0be682d9d0/master/w_2560%2Cc_limit/Monkey-Selfie.jpg"
}
],
"body": []
},
"organization": "232db54t058c00154d64345",
"name": "demowithpicture",
"description": "auto-ingested",
"namespace": "",
"language": "en",
"category": "ALERT_UPDATE",
"components": [],
"status": "APPROVED",
"enabled": true,
"messageTemplateId": "8975875675876677",
"createdAt": "2022-11-08T13:31:24.035Z",
"updatedAt": "2022-11-22T12:32:19.469Z",
"version": 1,
"id": "6695706dfs9569659765j709"
}
Want a list of Templates?
This endpoint allows you to retrieve a list of all templates.
Request to List Templates
API request to List templates
Organization ID
GET /v1.1/org/{orgId}/templates/list HTTP/1.1
Host: www.channel360.co.za
Accept: */*
Successfully retrieved Template List
{
"tags": {
"head": [],
"body": {
"index": 1,
"type": "hard-coded",
"value": "tag"
}
},
"organization": "659039655cf56a8df0c8908",
"name": "order_shipped",
"description": "A Template to test an alert",
"namespace": "default",
"language": "en_US",
"category": "ALERT_UPDATE",
"components": [],
"status": "APPROVED",
"enabled": true,
"messageTemplateId": "232136887459187",
"createdAt": "2023-04-05T09:49:51.064Z",
"updatedAt": "2023-09-13T11:12:53.984Z",
"version": 121,
"id": "1443f649u7053539346"
}
Want to filter & query your templates list?
These queries and filter's will allow you to list relevant templates.
Request for enabled and configured
API request to list enabled & configured templates
Filter templates by enabled status
true
Possible values: Filter templates by configuration (configured)
configured
GET /v1.1/org/orgId/templates/list HTTP/1.1
Host: www.channel360.co.za
Authorization: Bearer JWT
Accept: */*
Successfully retrieved template enabled and configured list
{
"tags": {
"head": [],
"body": {
"index": 1,
"type": "hard-coded",
"value": "tag"
}
},
"organization": "659039655cf56a8df0c8908",
"name": "order_shipped",
"description": "A Template to test an alert",
"namespace": "default",
"language": "en_US",
"category": "ALERT_UPDATE",
"components": [],
"status": "APPROVED",
"enabled": true,
"messageTemplateId": "232136887459187",
"createdAt": "2023-04-05T09:49:51.064Z",
"updatedAt": "2023-09-13T11:12:53.984Z",
"version": 121,
"id": "1443f649u7053539346"
}
Want templates by their enabled status?
You can query the template by their enabled status
Request only enabled templates
API request to list enabled templates
Filter templates by their enabled status
true
Possible values: GET /v1.1/org/:orgId/templates/list HTTP/1.1
Host: www.channel360.co.za
Authorization: Bearer JWT
Accept: */*
Successfully retrieved enabled templates
{
"tags": {
"head": [],
"body": {
"index": 1,
"type": "hard-coded",
"value": "tag"
}
},
"organization": "659039655cf56a8df0c8908",
"name": "order_shipped",
"description": "A Template to test an alert",
"namespace": "default",
"language": "en_US",
"category": "ALERT_UPDATE",
"components": [],
"status": "APPROVED",
"enabled": true,
"messageTemplateId": "232136887459187",
"createdAt": "2023-04-05T09:49:51.064Z",
"updatedAt": "2023-09-13T11:12:53.984Z",
"version": 121,
"id": "1443f649u7053539346"
}
Last updated
Was this helpful?