Templates
Get a WhatsApp template
GET
/
templates
/
{id}
Get a WhatsApp template
curl --request GET \
--url https://shortext.ny-corp.io/api/v2.0/templates/{id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/v2.0/templates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://shortext.ny-corp.io/api/v2.0/templates/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://shortext.ny-corp.io/api/v2.0/templates/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"code": 1000,
"message": "Request success.",
"body": {
"id": "<string>",
"name": "order_update",
"language": "fr",
"status": "APPROVED",
"rejection_reason": "<string>",
"quality": "GREEN",
"category": "UTILITY",
"channels": [
"<string>"
],
"header": {
"type": "NONE",
"text": "<string>",
"variables": [
"<string>"
],
"media_url": "<string>"
},
"body": {
"text": "Hello {{name}}, your order {{order}} is ready.",
"variables": [
"name",
"order"
]
},
"footer": "<string>",
"buttons": [
{
"index": 0,
"type": "URL",
"text": "<string>",
"needs_value": true
}
],
"updated_at": "2023-11-07T05:31:56Z"
},
"token": "<string>",
"trace_id": "<string>"
}Authorizations
Company API key, sent as Authorization: Bearer <key>. Create it in the dashboard (Developer > API Keys) with the permissions the integration needs.
Path Parameters
Response
200 - application/json
Always HTTP 200: the outcome is in success and code (absolute value of the response code).
⌘I
Get a WhatsApp template
curl --request GET \
--url https://shortext.ny-corp.io/api/v2.0/templates/{id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/v2.0/templates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://shortext.ny-corp.io/api/v2.0/templates/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://shortext.ny-corp.io/api/v2.0/templates/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"code": 1000,
"message": "Request success.",
"body": {
"id": "<string>",
"name": "order_update",
"language": "fr",
"status": "APPROVED",
"rejection_reason": "<string>",
"quality": "GREEN",
"category": "UTILITY",
"channels": [
"<string>"
],
"header": {
"type": "NONE",
"text": "<string>",
"variables": [
"<string>"
],
"media_url": "<string>"
},
"body": {
"text": "Hello {{name}}, your order {{order}} is ready.",
"variables": [
"name",
"order"
]
},
"footer": "<string>",
"buttons": [
{
"index": 0,
"type": "URL",
"text": "<string>",
"needs_value": true
}
],
"updated_at": "2023-11-07T05:31:56Z"
},
"token": "<string>",
"trace_id": "<string>"
}