メインコンテンツへスキップ
POST
https://{tenantDomain}/api/v2
/
roles
/
{id}
/
users
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Roles;
using System.Collections.Generic;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Roles.Users.AssignAsync(
            id: "id",
            request: new AssignRoleUsersRequestContent {
                Users = new List<string>(){
                    "users",
                }

            }
        );
    }

}
package example

import (
context "context"

client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
roles "github.com/auth0/go-auth0/management/management/roles"
)

func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &roles.AssignRoleUsersRequestContent{
Users: []string{
"users",
},
}
client.Roles.Users.Assign(
context.TODO(),
"id",
request,
)
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.roles.users.requests.AssignRoleUsersRequestContent;
import java.util.Arrays;

public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();

client.roles().users().assign(
"id",
AssignRoleUsersRequestContent
.builder()
.users(
Arrays.asList("users")
)
.build()
);
}
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Roles\Users\Requests\AssignRoleUsersRequestContent;

$client = new Management(
token: '<token>',
);
$client->roles->users->assign(
'id',
new AssignRoleUsersRequestContent([
'users' => [
'users',
],
]),
);
from auth0.management import ManagementClient

client = ManagementClient(
token="<token>",
)

client.roles.users.assign(
id="id",
users=[
"users"
],
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.roles.users.assign(
id: "id",
users: ["users"]
)
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.roles.users.assign("id", {
users: [
"users",
],
});
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.roles.users.assign("id", {
users: [
"users",
],
});
}
main();
curl --request POST \
--url https://{tenantDomain}/api/v2/roles/{id}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"users": [
"<string>"
]
}
'

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

パスパラメータ

id
string
必須

ID of the role to assign users to.

ボディ

users
string<user-id-with-max-length>[]
必須

user_id's of the users to assign the role to.

レスポンス

Role users successfully updated.