Create auto-response setting
POST
/
messaging_profiles
/
{profile_id}
/
autoresp_configs
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const autoRespConfigResponse = await client.messagingProfiles.autorespConfigs.create('profile_id', {
country_code: 'US',
keywords: ['keyword1', 'keyword2'],
op: 'start',
});
console.log(autoRespConfigResponse.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
)
auto_resp_config_response = client.messaging_profiles.autoresp_configs.create(
profile_id="profile_id",
country_code="US",
keywords=["keyword1", "keyword2"],
op="start",
)
print(auto_resp_config_response.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"),
)
autoRespConfigResponse, err := client.MessagingProfiles.AutorespConfigs.New(
context.TODO(),
"profile_id",
telnyx.MessagingProfileAutorespConfigNewParams{
AutoRespConfigCreate: telnyx.AutoRespConfigCreateParam{
CountryCode: "US",
Keywords: []string{"keyword1", "keyword2"},
Op: telnyx.AutoRespConfigCreateOpStart,
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", autoRespConfigResponse.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messagingprofiles.autorespconfigs.AutoRespConfigCreate;
import com.telnyx.sdk.models.messagingprofiles.autorespconfigs.AutoRespConfigResponse;
import com.telnyx.sdk.models.messagingprofiles.autorespconfigs.AutorespConfigCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AutorespConfigCreateParams params = AutorespConfigCreateParams.builder()
.profileId("profile_id")
.autoRespConfigCreate(AutoRespConfigCreate.builder()
.countryCode("US")
.addKeyword("keyword1")
.addKeyword("keyword2")
.op(AutoRespConfigCreate.Op.START)
.build())
.build();
AutoRespConfigResponse autoRespConfigResponse = client.messagingProfiles().autorespConfigs().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
auto_resp_config_response = telnyx.messaging_profiles.autoresp_configs.create(
"profile_id",
country_code: "US",
keywords: ["keyword1", "keyword2"],
op: :start
)
puts(auto_resp_config_response)<?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 {
$autoRespConfigResponse = $client->messagingProfiles->autorespConfigs->create(
'profile_id',
countryCode: 'US',
keywords: ['keyword1', 'keyword2'],
op: 'start',
respText: 'Thank you for your message',
);
var_dump($autoRespConfigResponse);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messaging-profiles:autoresp-configs create \
--api-key 'My API Key' \
--profile-id profile_id \
--country-code US \
--keyword keyword1 \
--keyword keyword2 \
--op startcurl --request POST \
--url https://api.telnyx.com/v2/messaging_profiles/{profile_id}/autoresp_configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"keywords": [
"keyword1",
"keyword2"
],
"country_code": "US",
"resp_text": "Thank you for your message"
}
'{
"data": {
"op": "start",
"keywords": [
"START"
],
"resp_text": "Hello there!",
"country_code": "US",
"id": "c2298f86-a4dc-4cac-b6b6-4a3d01c290fa",
"created_at": "2023-03-22T00:06:49.068817+00:00",
"updated_at": "2023-03-22T00:06:49.068817+00:00"
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the profile.
Body
application/json
Response
Successful Response
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 autoRespConfigResponse = await client.messagingProfiles.autorespConfigs.create('profile_id', {
country_code: 'US',
keywords: ['keyword1', 'keyword2'],
op: 'start',
});
console.log(autoRespConfigResponse.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
)
auto_resp_config_response = client.messaging_profiles.autoresp_configs.create(
profile_id="profile_id",
country_code="US",
keywords=["keyword1", "keyword2"],
op="start",
)
print(auto_resp_config_response.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"),
)
autoRespConfigResponse, err := client.MessagingProfiles.AutorespConfigs.New(
context.TODO(),
"profile_id",
telnyx.MessagingProfileAutorespConfigNewParams{
AutoRespConfigCreate: telnyx.AutoRespConfigCreateParam{
CountryCode: "US",
Keywords: []string{"keyword1", "keyword2"},
Op: telnyx.AutoRespConfigCreateOpStart,
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", autoRespConfigResponse.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messagingprofiles.autorespconfigs.AutoRespConfigCreate;
import com.telnyx.sdk.models.messagingprofiles.autorespconfigs.AutoRespConfigResponse;
import com.telnyx.sdk.models.messagingprofiles.autorespconfigs.AutorespConfigCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AutorespConfigCreateParams params = AutorespConfigCreateParams.builder()
.profileId("profile_id")
.autoRespConfigCreate(AutoRespConfigCreate.builder()
.countryCode("US")
.addKeyword("keyword1")
.addKeyword("keyword2")
.op(AutoRespConfigCreate.Op.START)
.build())
.build();
AutoRespConfigResponse autoRespConfigResponse = client.messagingProfiles().autorespConfigs().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
auto_resp_config_response = telnyx.messaging_profiles.autoresp_configs.create(
"profile_id",
country_code: "US",
keywords: ["keyword1", "keyword2"],
op: :start
)
puts(auto_resp_config_response)<?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 {
$autoRespConfigResponse = $client->messagingProfiles->autorespConfigs->create(
'profile_id',
countryCode: 'US',
keywords: ['keyword1', 'keyword2'],
op: 'start',
respText: 'Thank you for your message',
);
var_dump($autoRespConfigResponse);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messaging-profiles:autoresp-configs create \
--api-key 'My API Key' \
--profile-id profile_id \
--country-code US \
--keyword keyword1 \
--keyword keyword2 \
--op startcurl --request POST \
--url https://api.telnyx.com/v2/messaging_profiles/{profile_id}/autoresp_configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"keywords": [
"keyword1",
"keyword2"
],
"country_code": "US",
"resp_text": "Thank you for your message"
}
'{
"data": {
"op": "start",
"keywords": [
"START"
],
"resp_text": "Hello there!",
"country_code": "US",
"id": "c2298f86-a4dc-4cac-b6b6-4a3d01c290fa",
"created_at": "2023-03-22T00:06:49.068817+00:00",
"updated_at": "2023-03-22T00:06:49.068817+00:00"
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}