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"
}Créer un fournisseur de téléphonie
Crée un fournisseur de téléphonie.
L’objet credentials requiert des propriétés différentes selon le fournisseur de téléphonie (indiqué à l’aide de la propriété name).
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"
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
Schéma de configuration du fournisseur de téléphonie
Informations d’identification du fournisseur requises pour s’authentifier auprès du fournisseur.
- Option 1
- Option 2
Show child attributes
Show child attributes
Nom du fournisseur de notifications par téléphone
twilio, custom 1 - 100- Option 1
- Option 2
Show child attributes
Show child attributes
Indique si le fournisseur est activé (false) ou désactivé (true).
Réponse
Le fournisseur de notifications téléphoniques a été créé avec succès.
Schéma de configuration du fournisseur de téléphonie
Nom du fournisseur de notifications par téléphone
twilio, custom 1 - 100Indique le type de notifications que ce fournisseur peut recevoir.
phone 100- Option 1
- Option 2
Show child attributes
Show child attributes
La date et l’heure de création du fournisseur au format ISO 8601
27Indique si le fournisseur est activé (false) ou désactivé (true).
1 - 255Le nom du tenant
1 - 255La date et l’heure de la dernière mise à jour du fournisseur au format ISO 8601
27