using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Branding.Phone;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await client.Branding.Phone.Providers.CreateAsync(
new CreateBrandingPhoneProviderRequestContent {
Name = PhoneProviderNameEnum.Twilio,
Credentials = new TwilioProviderCredentials {
AuthToken = "auth_token"
}
}
);
}
}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,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.branding.phone.providers.requests.CreateBrandingPhoneProviderRequestContent;
import com.auth0.client.mgmt.types.PhoneProviderCredentials;
import com.auth0.client.mgmt.types.PhoneProviderNameEnum;
import com.auth0.client.mgmt.types.TwilioProviderCredentials;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.branding().phone().providers().create(
CreateBrandingPhoneProviderRequestContent
.builder()
.name(PhoneProviderNameEnum.TWILIO)
.credentials(
PhoneProviderCredentials.of(
TwilioProviderCredentials
.builder()
.authToken("auth_token")
.build()
)
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Branding\Phone\Providers\Requests\CreateBrandingPhoneProviderRequestContent;
use Auth0\SDK\API\Management\Types\PhoneProviderNameEnum;
use Auth0\SDK\API\Management\Types\TwilioProviderCredentials;
$client = new Management(
token: '<token>',
);
$client->branding->phone->providers->create(
new CreateBrandingPhoneProviderRequestContent([
'name' => PhoneProviderNameEnum::Twilio->value,
'credentials' => new TwilioProviderCredentials([
'authToken' => 'auth_token',
]),
]),
);from auth0.management import ManagementClient, TwilioProviderCredentials
client = ManagementClient(
token="<token>",
)
client.branding.phone.providers.create(
name="twilio",
credentials=TwilioProviderCredentials(
auth_token="auth_token",
),
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.branding.phone.providers.create(
name: "twilio",
credentials: {
auth_token: "auth_token"
}
)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>"
}
}
'{
"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).
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Branding.Phone;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await client.Branding.Phone.Providers.CreateAsync(
new CreateBrandingPhoneProviderRequestContent {
Name = PhoneProviderNameEnum.Twilio,
Credentials = new TwilioProviderCredentials {
AuthToken = "auth_token"
}
}
);
}
}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,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.branding.phone.providers.requests.CreateBrandingPhoneProviderRequestContent;
import com.auth0.client.mgmt.types.PhoneProviderCredentials;
import com.auth0.client.mgmt.types.PhoneProviderNameEnum;
import com.auth0.client.mgmt.types.TwilioProviderCredentials;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.branding().phone().providers().create(
CreateBrandingPhoneProviderRequestContent
.builder()
.name(PhoneProviderNameEnum.TWILIO)
.credentials(
PhoneProviderCredentials.of(
TwilioProviderCredentials
.builder()
.authToken("auth_token")
.build()
)
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Branding\Phone\Providers\Requests\CreateBrandingPhoneProviderRequestContent;
use Auth0\SDK\API\Management\Types\PhoneProviderNameEnum;
use Auth0\SDK\API\Management\Types\TwilioProviderCredentials;
$client = new Management(
token: '<token>',
);
$client->branding->phone->providers->create(
new CreateBrandingPhoneProviderRequestContent([
'name' => PhoneProviderNameEnum::Twilio->value,
'credentials' => new TwilioProviderCredentials([
'authToken' => 'auth_token',
]),
]),
);from auth0.management import ManagementClient, TwilioProviderCredentials
client = ManagementClient(
token="<token>",
)
client.branding.phone.providers.create(
name="twilio",
credentials=TwilioProviderCredentials(
auth_token="auth_token",
),
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.branding.phone.providers.create(
name: "twilio",
credentials: {
auth_token: "auth_token"
}
)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>"
}
}
'{
"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