package example
import (
context "context"
management "github.com/auth0/go-auth0/management/management"
phone "github.com/auth0/go-auth0/management/management/branding/phone"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &phone.CreateBrandingPhoneProviderRequestContent{
Name: management.PhoneProviderNameEnumTwilio,
Credentials: &management.PhoneProviderCredentials{
TwilioProviderCredentials: &management.TwilioProviderCredentials{
AuthToken: "auth_token",
},
},
}
client.Branding.Phone.Providers.Create(
context.TODO(),
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.branding.phone.providers.create({
name: "twilio",
credentials: {
authToken: "auth_token",
},
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.branding.phone.providers.create({
name: "twilio",
credentials: {
authToken: "auth_token",
},
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/branding/phone/providers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credentials": {
"auth_token": "<string>"
},
"disabled": true,
"configuration": {
"sid": "<string>",
"delivery_methods": [],
"default_from": "<string>",
"mssid": "<string>"
}
}
'import requests
url = "https://{tenantDomain}/api/v2/branding/phone/providers"
payload = {
"credentials": { "auth_token": "<string>" },
"disabled": True,
"configuration": {
"sid": "<string>",
"delivery_methods": [],
"default_from": "<string>",
"mssid": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/branding/phone/providers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'credentials' => [
'auth_token' => '<string>'
],
'disabled' => true,
'configuration' => [
'sid' => '<string>',
'delivery_methods' => [
],
'default_from' => '<string>',
'mssid' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/branding/phone/providers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": {\n \"auth_token\": \"<string>\"\n },\n \"disabled\": true,\n \"configuration\": {\n \"sid\": \"<string>\",\n \"delivery_methods\": [],\n \"default_from\": \"<string>\",\n \"mssid\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/branding/phone/providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": {\n \"auth_token\": \"<string>\"\n },\n \"disabled\": true,\n \"configuration\": {\n \"sid\": \"<string>\",\n \"delivery_methods\": [],\n \"default_from\": \"<string>\",\n \"mssid\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"tenant": "<string>",
"channel": "phone",
"disabled": true,
"configuration": {
"sid": "<string>",
"delivery_methods": [],
"default_from": "<string>",
"mssid": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Configure the phone provider
Create a phone provider.
The credentials object requires different properties depending on the phone provider (which is specified using the name property).
package example
import (
context "context"
management "github.com/auth0/go-auth0/management/management"
phone "github.com/auth0/go-auth0/management/management/branding/phone"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &phone.CreateBrandingPhoneProviderRequestContent{
Name: management.PhoneProviderNameEnumTwilio,
Credentials: &management.PhoneProviderCredentials{
TwilioProviderCredentials: &management.TwilioProviderCredentials{
AuthToken: "auth_token",
},
},
}
client.Branding.Phone.Providers.Create(
context.TODO(),
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.branding.phone.providers.create({
name: "twilio",
credentials: {
authToken: "auth_token",
},
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.branding.phone.providers.create({
name: "twilio",
credentials: {
authToken: "auth_token",
},
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/branding/phone/providers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credentials": {
"auth_token": "<string>"
},
"disabled": true,
"configuration": {
"sid": "<string>",
"delivery_methods": [],
"default_from": "<string>",
"mssid": "<string>"
}
}
'import requests
url = "https://{tenantDomain}/api/v2/branding/phone/providers"
payload = {
"credentials": { "auth_token": "<string>" },
"disabled": True,
"configuration": {
"sid": "<string>",
"delivery_methods": [],
"default_from": "<string>",
"mssid": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/branding/phone/providers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'credentials' => [
'auth_token' => '<string>'
],
'disabled' => true,
'configuration' => [
'sid' => '<string>',
'delivery_methods' => [
],
'default_from' => '<string>',
'mssid' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/branding/phone/providers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": {\n \"auth_token\": \"<string>\"\n },\n \"disabled\": true,\n \"configuration\": {\n \"sid\": \"<string>\",\n \"delivery_methods\": [],\n \"default_from\": \"<string>\",\n \"mssid\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/branding/phone/providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": {\n \"auth_token\": \"<string>\"\n },\n \"disabled\": true,\n \"configuration\": {\n \"sid\": \"<string>\",\n \"delivery_methods\": [],\n \"default_from\": \"<string>\",\n \"mssid\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"tenant": "<string>",
"channel": "phone",
"disabled": true,
"configuration": {
"sid": "<string>",
"delivery_methods": [],
"default_from": "<string>",
"mssid": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
Phone provider configuration schema
Name of the phone notification provider
twilio, custom 1 - 100Provider credentials required to use authenticate to the provider.
- Option 1
- Option 2
Show child attributes
Show child attributes
Whether the provider is enabled (false) or disabled (true).
- Option 1
- Option 2
Show child attributes
Show child attributes
レスポンス
Phone notification provider successfully created.
Phone provider configuration schema
Name of the phone notification provider
twilio, custom 1 - 1001 - 255The name of the tenant
1 - 255This depicts the type of notifications this provider can receive.
phone 100Whether the provider is enabled (false) or disabled (true).
- Option 1
- Option 2
Show child attributes
Show child attributes
The provider's creation date and time in ISO 8601 format
27The date and time of the last update to the provider in ISO 8601 format
27