C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Users;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await client.Users.Roles.ListAsync(
id: "id",
request: new ListUserRolesRequestParameters {
PerPage = 1,
Page = 1,
IncludeTotals = true
}
);
}
}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"
users "github.com/auth0/go-auth0/management/management/users"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &users.ListUserRolesRequestParameters{
PerPage: management.Int(
1,
),
Page: management.Int(
1,
),
IncludeTotals: management.Bool(
true,
),
}
client.Users.Roles.List(
context.TODO(),
"id",
request,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.users.roles.requests.ListUserRolesRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.users().roles().list(
"id",
ListUserRolesRequestParameters
.builder()
.perPage(1)
.page(1)
.includeTotals(true)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Users\Roles\Requests\ListUserRolesRequestParameters;
$client = new Management(
token: '<token>',
);
$client->users->roles->list(
'id',
new ListUserRolesRequestParameters([
'perPage' => 1,
'page' => 1,
'includeTotals' => true,
]),
);from auth0.management import ManagementClient
client = ManagementClient(
token="<token>",
)
client.users.roles.list(
id="id",
per_page=1,
page=1,
include_totals=True,
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.users.roles.list(
id: "id",
per_page: 1,
page: 1,
include_totals: true
)import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.roles.list("id", {
perPage: 1,
page: 1,
includeTotals: true,
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.roles.list("id", {
perPage: 1,
page: 1,
includeTotals: true,
});
}
main();curl --request GET \
--url https://{tenantDomain}/api/v2/users/{id}/roles \
--header 'Authorization: Bearer <token>'[
{
"id": "<string>",
"name": "<string>",
"description": "<string>"
}
]Get a user's roles
Retrieve detailed list of all user roles currently assigned to a user.
Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.
GET
https://{tenantDomain}/api/v2
/
users
/
{id}
/
roles
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Users;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await client.Users.Roles.ListAsync(
id: "id",
request: new ListUserRolesRequestParameters {
PerPage = 1,
Page = 1,
IncludeTotals = true
}
);
}
}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"
users "github.com/auth0/go-auth0/management/management/users"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &users.ListUserRolesRequestParameters{
PerPage: management.Int(
1,
),
Page: management.Int(
1,
),
IncludeTotals: management.Bool(
true,
),
}
client.Users.Roles.List(
context.TODO(),
"id",
request,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.users.roles.requests.ListUserRolesRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.users().roles().list(
"id",
ListUserRolesRequestParameters
.builder()
.perPage(1)
.page(1)
.includeTotals(true)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Users\Roles\Requests\ListUserRolesRequestParameters;
$client = new Management(
token: '<token>',
);
$client->users->roles->list(
'id',
new ListUserRolesRequestParameters([
'perPage' => 1,
'page' => 1,
'includeTotals' => true,
]),
);from auth0.management import ManagementClient
client = ManagementClient(
token="<token>",
)
client.users.roles.list(
id="id",
per_page=1,
page=1,
include_totals=True,
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.users.roles.list(
id: "id",
per_page: 1,
page: 1,
include_totals: true
)import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.roles.list("id", {
perPage: 1,
page: 1,
includeTotals: true,
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.roles.list("id", {
perPage: 1,
page: 1,
includeTotals: true,
});
}
main();curl --request GET \
--url https://{tenantDomain}/api/v2/users/{id}/roles \
--header 'Authorization: Bearer <token>'[
{
"id": "<string>",
"name": "<string>",
"description": "<string>"
}
]Autorisations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de chemin
ID of the user to list roles for.
Paramètres de requête
Number of results per page.
Plage requise:
1 <= x <= 100Page index of the results to return. First page is 0.
Plage requise:
x >= 0Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
⌘I