Update message template
Update an existing Verify profile message template.
PATCH
/
verify_profiles
/
templates
/
{template_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const messageTemplate = await client.verifyProfiles.updateTemplate(
'12ade33a-21c0-473b-b055-b3c836e1c292',
{ text: 'Your {{app_name}} verification code is: {{code}}.' },
);
console.log(messageTemplate.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
message_template = client.verify_profiles.update_template(
template_id="12ade33a-21c0-473b-b055-b3c836e1c292",
text="Your {{app_name}} verification code is: {{code}}.",
)
print(message_template.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
messageTemplate, err := client.VerifyProfiles.UpdateTemplate(
context.TODO(),
"12ade33a-21c0-473b-b055-b3c836e1c292",
telnyx.VerifyProfileUpdateTemplateParams{
Text: "Your {{app_name}} verification code is: {{code}}.",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messageTemplate.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.verifyprofiles.MessageTemplate;
import com.telnyx.sdk.models.verifyprofiles.VerifyProfileUpdateTemplateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
VerifyProfileUpdateTemplateParams params = VerifyProfileUpdateTemplateParams.builder()
.templateId("12ade33a-21c0-473b-b055-b3c836e1c292")
.text("Your {{app_name}} verification code is: {{code}}.")
.build();
MessageTemplate messageTemplate = client.verifyProfiles().updateTemplate(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
message_template = telnyx.verify_profiles.update_template(
"12ade33a-21c0-473b-b055-b3c836e1c292",
text: "Your {{app_name}} verification code is: {{code}}."
)
puts(message_template)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$messageTemplate = $client->verifyProfiles->updateTemplate(
'12ade33a-21c0-473b-b055-b3c836e1c292',
text: 'Your {{app_name}} verification code is: {{code}}.',
);
var_dump($messageTemplate);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx verify-profiles update-template \
--api-key 'My API Key' \
--template-id 12ade33a-21c0-473b-b055-b3c836e1c292 \
--text 'Your {{app_name}} verification code is: {{code}}.'curl --request PATCH \
--url https://api.telnyx.com/v2/verify_profiles/templates/{template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Your {{app_name}} verification code is: {{code}}."
}
'{
"data": {
"id": "0abb5b4f-459f-445a-bfcd-488998b7572d",
"text": "Your {{app_name}} verification code is: {{code}}."
}
}{
"errors": [
{
"code": "10015",
"title": "Invalid sorting value",
"detail": "The value provided for sorting is not valid. Check the value used and try again.",
"source": {
"pointer": "/sort",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The identifier of the message template to update.
Example:
"12ade33a-21c0-473b-b055-b3c836e1c292"
Body
application/json
The request body when updating a message template.
The text content of the message template.
Example:
"Your {{app_name}} verification code is: {{code}}."
Response
Expected message template response to a valid request.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const messageTemplate = await client.verifyProfiles.updateTemplate(
'12ade33a-21c0-473b-b055-b3c836e1c292',
{ text: 'Your {{app_name}} verification code is: {{code}}.' },
);
console.log(messageTemplate.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
message_template = client.verify_profiles.update_template(
template_id="12ade33a-21c0-473b-b055-b3c836e1c292",
text="Your {{app_name}} verification code is: {{code}}.",
)
print(message_template.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
messageTemplate, err := client.VerifyProfiles.UpdateTemplate(
context.TODO(),
"12ade33a-21c0-473b-b055-b3c836e1c292",
telnyx.VerifyProfileUpdateTemplateParams{
Text: "Your {{app_name}} verification code is: {{code}}.",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messageTemplate.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.verifyprofiles.MessageTemplate;
import com.telnyx.sdk.models.verifyprofiles.VerifyProfileUpdateTemplateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
VerifyProfileUpdateTemplateParams params = VerifyProfileUpdateTemplateParams.builder()
.templateId("12ade33a-21c0-473b-b055-b3c836e1c292")
.text("Your {{app_name}} verification code is: {{code}}.")
.build();
MessageTemplate messageTemplate = client.verifyProfiles().updateTemplate(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
message_template = telnyx.verify_profiles.update_template(
"12ade33a-21c0-473b-b055-b3c836e1c292",
text: "Your {{app_name}} verification code is: {{code}}."
)
puts(message_template)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$messageTemplate = $client->verifyProfiles->updateTemplate(
'12ade33a-21c0-473b-b055-b3c836e1c292',
text: 'Your {{app_name}} verification code is: {{code}}.',
);
var_dump($messageTemplate);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx verify-profiles update-template \
--api-key 'My API Key' \
--template-id 12ade33a-21c0-473b-b055-b3c836e1c292 \
--text 'Your {{app_name}} verification code is: {{code}}.'curl --request PATCH \
--url https://api.telnyx.com/v2/verify_profiles/templates/{template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Your {{app_name}} verification code is: {{code}}."
}
'{
"data": {
"id": "0abb5b4f-459f-445a-bfcd-488998b7572d",
"text": "Your {{app_name}} verification code is: {{code}}."
}
}{
"errors": [
{
"code": "10015",
"title": "Invalid sorting value",
"detail": "The value provided for sorting is not valid. Check the value used and try again.",
"source": {
"pointer": "/sort",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}