C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Branding.Phone;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
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/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.CreateBrandingPhoneProviderRequestContent{
Name: management.PhoneProviderNameEnumTwilio,
Credentials: &management.PhoneProviderCredentials{
TwilioProviderCredentials: &management.TwilioProviderCredentials{
AuthToken: "auth_token",
},
},
}
mgmt.Branding.Phone.Providers.Create(
context.TODO(),
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.branding.phone.types.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()
.domain("{YOUR_DOMAIN}")
.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\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
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 ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
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(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.branding.phone.providers.create(
name="twilio",
credentials=TwilioProviderCredentials(
auth_token="auth_token",
),
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.branding.phone.providers.create(
name: "twilio",
credentials: {
auth_token: "auth_token"
}
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
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({
domain: "{YOUR_DOMAIN}",
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>"
},
"configuration": {
"delivery_methods": [],
"sid": "<string>",
"default_from": "<string>",
"mssid": "<string>"
},
"disabled": true
}
'{
"channel": "phone",
"configuration": {
"delivery_methods": [],
"sid": "<string>",
"default_from": "<string>",
"mssid": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"disabled": true,
"id": "<string>",
"tenant": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}電話プロバイダーを作成
電話プロバイダーを作成します。
credentials オブジェクトには、電話プロバイダー(name プロパティで指定)に応じて異なるプロパティが必要です。
POST
https://{tenantDomain}/api/v2
/
branding
/
phone
/
providers
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Branding.Phone;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
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/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.CreateBrandingPhoneProviderRequestContent{
Name: management.PhoneProviderNameEnumTwilio,
Credentials: &management.PhoneProviderCredentials{
TwilioProviderCredentials: &management.TwilioProviderCredentials{
AuthToken: "auth_token",
},
},
}
mgmt.Branding.Phone.Providers.Create(
context.TODO(),
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.branding.phone.types.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()
.domain("{YOUR_DOMAIN}")
.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\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
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 ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
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(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.branding.phone.providers.create(
name="twilio",
credentials=TwilioProviderCredentials(
auth_token="auth_token",
),
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.branding.phone.providers.create(
name: "twilio",
credentials: {
auth_token: "auth_token"
}
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
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({
domain: "{YOUR_DOMAIN}",
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>"
},
"configuration": {
"delivery_methods": [],
"sid": "<string>",
"default_from": "<string>",
"mssid": "<string>"
},
"disabled": true
}
'{
"channel": "phone",
"configuration": {
"delivery_methods": [],
"sid": "<string>",
"default_from": "<string>",
"mssid": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"disabled": true,
"id": "<string>",
"tenant": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}承認
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
application/jsonapplication/x-www-form-urlencoded
レスポンス
電話通知プロバイダーが正常に作成されました。
電話プロバイダーの設定スキーマ
電話通知プロバイダーの名前
利用可能なオプション:
twilio, custom Required string length:
1 - 100このプロバイダーが受信できる通知の種類を示します。
利用可能なオプション:
phone Maximum string length:
100- Option 1
- Option 2
Show child attributes
Show child attributes
ISO 8601 形式で表したプロバイダーの作成日時
Maximum string length:
27プロバイダーが有効(false)か無効(true)か。
Required string length:
1 - 255tenant の名前
Required string length:
1 - 255ISO 8601 形式で表したプロバイダーの最終更新日時
Maximum string length:
27⌘I