Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
roles
/
{id}
/
users
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Roles;

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

        await client.Roles.Users.ListAsync(
            id: "id",
            request: new ListRoleUsersRequestParameters {
                From = "from",
                Take = 1
            }
        );
    }

}
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    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.ListRoleUsersRequestParameters{
        From: management.String(
            "from",
        ),
        Take: management.Int(
            1,
        ),
    }
    client.Roles.Users.List(
        context.TODO(),
        "id",
        request,
    )
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.roles.users.requests.ListRoleUsersRequestParameters;

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

        client.roles().users().list(
            "id",
            ListRoleUsersRequestParameters
                .builder()
                .from("from")
                .take(1)
                .build()
        );
    }
}
<?php

namespace Example;

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

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

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

client.roles.users.list(
    id="id",
    from="from",
    take=1,
)
require "auth0"

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

client.roles.users.list(
  id: "id",
  from: "from",
  take: 1
)
import { ManagementClient } from "auth0";

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

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.roles.users.list("id", {
        from: "from",
        take: 1,
    });
}
main();
curl --request GET \
  --url https://{tenantDomain}/api/v2/roles/{id}/users \
  --header 'Authorization: Bearer <token>'
[
  {
    "user_id": "<string>",
    "picture": "<string>",
    "name": "<string>",
    "email": "john.doe@gmail.com"
  }
]

Autorisations

Authorization
string
header
requis

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

Paramètres de chemin

id
string
requis

ID of the role to retrieve a list of users associated with.

Paramètres de requête

per_page
integer

Number of results per page. Defaults to 50.

Plage requise: 1 <= x <= 100
page
integer

Page index of the results to return. First page is 0.

Plage requise: x >= 0
include_totals
boolean

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

from
string

Optional Id from which to start selection.

take
integer

Number of results per page. Defaults to 50.

Plage requise: 1 <= x <= 100

Réponse

Role users successfully retrieved.

user_id
string

ID of this user.

picture
string

URL to a picture for this user.

name
string

Name of this user.

email
string<email>
défaut:john.doe@gmail.com

Email address of this user.