package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.CreatedUserAuthenticationMethodTypeEnum;
import com.auth0.client.mgmt.users.types.CreateUserAuthenticationMethodRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.users().authenticationMethods().create(
"id",
CreateUserAuthenticationMethodRequestContent
.builder()
.type(CreatedUserAuthenticationMethodTypeEnum.PHONE)
.build()
);
}
}
<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Users\AuthenticationMethods\Requests\CreateUserAuthenticationMethodRequestContent;
use Auth0\SDK\API\Management\Types\CreatedUserAuthenticationMethodTypeEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->users->authenticationMethods->create(
'id',
new CreateUserAuthenticationMethodRequestContent([
'type' => CreatedUserAuthenticationMethodTypeEnum::Phone->value,
]),
);
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.CreatedUserAuthenticationMethodTypeEnum;
import com.auth0.client.mgmt.users.types.CreateUserAuthenticationMethodRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.users().authenticationMethods().create(
"id",
CreateUserAuthenticationMethodRequestContent
.builder()
.type(CreatedUserAuthenticationMethodTypeEnum.PHONE)
.build()
);
}
}
<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Users\AuthenticationMethods\Requests\CreateUserAuthenticationMethodRequestContent;
use Auth0\SDK\API\Management\Types\CreatedUserAuthenticationMethodTypeEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->users->authenticationMethods->create(
'id',
new CreateUserAuthenticationMethodRequestContent([
'type' => CreatedUserAuthenticationMethodTypeEnum::Phone->value,
]),
);