PATCH /templates/:uuid
Updates an existing template.
Required Parameters
Parameter | Type | Description |
---|---|---|
uuid | string | The identifier of the template |
Optional Parameters
Parameter | Type | Description |
---|---|---|
title | string | The new title that will be given to the template |
Example Request
- cURL
- Node
- Ruby
- Go
- PHP
- Python
curl -X PATCH "https://api.callbell.eu/v1/templates/414a6d692bd645ed803f2e7ce360d4c8" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{"title": New title"}'
import axios from 'axios';
const response = await axios.patch(
'https://api.callbell.eu/v1/templates/414a6d692bd645ed803f2e7ce360d4c8',
'{"title": New title"}',
{
headers: {
'Authorization': 'Bearer test_gshuPaZoeEG6ovbc8M79w0QyM',
'Content-Type': 'application/json'
}
}
);
require 'net/http'
uri = URI('https://api.callbell.eu/v1/templates/414a6d692bd645ed803f2e7ce360d4c8')
req = Net::HTTP::Patch.new(uri)
req.content_type = 'application/json'
req['Authorization'] = 'Bearer test_gshuPaZoeEG6ovbc8M79w0QyM'
req.body = '{"title": New title"}'
req_options = {
use_ssl: uri.scheme == 'https'
}
res = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(req)
end
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"title": New title"}`)
req, err := http.NewRequest("PATCH", "https://api.callbell.eu/v1/templates/414a6d692bd645ed803f2e7ce360d4c8", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer test_gshuPaZoeEG6ovbc8M79w0QyM")
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bodyText, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.callbell.eu/v1/templates/414a6d692bd645ed803f2e7ce360d4c8');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"title": New title"}');
$response = curl_exec($ch);
curl_close($ch);
import requests
headers = {
'Authorization': 'Bearer test_gshuPaZoeEG6ovbc8M79w0QyM',
'Content-Type': 'application/json',
}
data = '{"title": New title"}'
response = requests.patch('https://api.callbell.eu/v1/templates/414a6d692bd645ed803f2e7ce360d4c8', headers=headers, data=data)
Response
Parameter | Type | Description |
---|---|---|
template | Template[] | The object representing the Whatsapp template message. |
Example Response
response.json
{
"templates": {
"uuid": "ad42a09715814e6483b1c5debd6a2dbc",
"title": "New title",
"templateType": "text",
"text": "Message text",
"createdAt": "2020-11-13T21:08:53Z"
}
}