Edit template using put method under your account
https://eu.cpaas.bics.com/api/v2/
{endpoint}sms/templates/{id}
Replace the {id} with the actual id of the template that you would like to Edit.
Name | Optinal | Descriptions |
---|---|---|
name | No | Input the name of the template that you would like to refer with |
body | No | Input the body of the sms(template) |
template_id | Mixed | DLT Template id (required for india) |
type | Mixed | Type of the template like (P, T, SI, SE)(required for india) |
is_english | No | Input the is_english (0, 1) |
curl --location --request PUT '{endpoint}/api/v2/sms/templates/c61293e2-14f1-405b-b299-2b71f16xxxxx' \
--header 'Authorization: Bearer 7160f04c05870ee88812a435f65xxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"sender": "vasavi",
"name": "temp12",
"body": "Welcome to mobtexting family",
"template_id": ""
}'
var client = new RestClient("{endpoint}/api/v2/sms/templates/c61293e2-14f1-405b-b299-2b71f16xxxxx");
client.Timeout = -1;
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer 7160f04c05870ee88812a435f65xxxxx");
request.AddHeader("Content-Type", "application/json");
var body = @"{" + "\n" +
@" ""sender"": ""xxxxx""," + "\n" +
@" ""name"": ""temp12""," + "\n" +
@" ""body"": ""Welcome to mobtexting family""," + "\n" +
@" ""template_id"": """"" + "\n" +
@"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var settings = {
"url": "{endpoint}/api/v2/sms/templates/c61293e2-14f1-405b-b299-2b71f16xxxxx",
"method": "PUT",
"timeout": 0,
"headers": {
"Authorization": "Bearer 7160f04c05870ee88812a435f65xxxxx",
"Content-Type": "application/json"
},
"data": JSON.stringify({
"sender": "xxxxx",
"name": "temp12",
"body": "Welcome to mobtexting family",
"template_id": ""
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var axios = require('axios');
var data = JSON.stringify({
"sender": "xxxxx",
"name": "temp12",
"body": "Welcome to mobtexting family",
"template_id": ""
});
var config = {
method: ‘put’,
url: ‘{endpoint}/api/v2/sms/templates/c61293e2-14f1-405b-b299-2b71f16xxxxx’,
headers: {
‘Authorization’: ‘Bearer 7160f04c05870ee88812a435f65xxxx’,
‘Content-Type’: ‘application/json’
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
{
"status": "OK",
"code": 200,
"message": "Template Update Successfully",
"data": {
"id": "b23769e6-019f-48f4-aae9-ec00a5xxxxxx",
"sender_id": "015c2f82-1352-4d19-9f8f-b8449xxxxxx",
"template_id": "110716152128335xxxx",
"template_type": "Transactional",
"sender": "SENDER",
"name": "hind-number",
"alias": "hind-number",
"body": "Your Verification code is:{{1}} is code {{2}}",
"content": null,
"body_length": 53,
"match_count": 0,
"percentage": 0,
"is_complete": 0,
"is_english": 1,
"status": 1,
"created_at": "2022-11-16T04:41:32.000000Z",
"updated_at": "2022-11-16T04:56:11.000000Z"
}
}