Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
device-credentials
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;

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

        await client.DeviceCredentials.ListAsync(
            new ListDeviceCredentialsRequestParameters {
                Page = 1,
                PerPage = 1,
                IncludeTotals = true,
                Fields = "fields",
                IncludeFields = true,
                UserId = "user_id",
                ClientId = "client_id",
                Type = DeviceCredentialTypeEnum.PublicKey
            }
        );
    }

}
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"
)

func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.ListDeviceCredentialsRequestParameters{
Page: management.Int(
1,
),
PerPage: management.Int(
1,
),
IncludeTotals: management.Bool(
true,
),
Fields: management.String(
"fields",
),
IncludeFields: management.Bool(
true,
),
UserId: management.String(
"user_id",
),
ClientId: management.String(
"client_id",
),
Type: management.DeviceCredentialTypeEnumPublicKey.Ptr(),
}
client.DeviceCredentials.List(
context.TODO(),
request,
)
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.devicecredentials.requests.ListDeviceCredentialsRequestParameters;
import com.auth0.client.mgmt.types.DeviceCredentialTypeEnum;

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

client.deviceCredentials().list(
ListDeviceCredentialsRequestParameters
.builder()
.page(1)
.perPage(1)
.includeTotals(true)
.fields("fields")
.includeFields(true)
.userId("user_id")
.clientId("client_id")
.type(DeviceCredentialTypeEnum.PUBLIC_KEY)
.build()
);
}
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\DeviceCredentials\Requests\ListDeviceCredentialsRequestParameters;
use Auth0\SDK\API\Management\Types\DeviceCredentialTypeEnum;

$client = new Management(
token: '<token>',
);
$client->deviceCredentials->list(
new ListDeviceCredentialsRequestParameters([
'page' => 1,
'perPage' => 1,
'includeTotals' => true,
'fields' => 'fields',
'includeFields' => true,
'userId' => 'user_id',
'clientId' => 'client_id',
'type' => DeviceCredentialTypeEnum::PublicKey->value,
]),
);
from auth0.management import ManagementClient

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

client.device_credentials.list(
page=1,
per_page=1,
include_totals=True,
fields="fields",
include_fields=True,
user_id="user_id",
client_id="client_id",
type="public_key",
)
require "auth0"

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

client.device_credentials.list(
page: 1,
per_page: 1,
include_totals: true,
fields: "fields",
include_fields: true,
user_id: "user_id",
client_id: "client_id",
type: "public_key"
)
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.deviceCredentials.list({
page: 1,
perPage: 1,
includeTotals: true,
fields: "fields",
includeFields: true,
userId: "user_id",
clientId: "client_id",
type: "public_key",
});
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.deviceCredentials.list({
page: 1,
perPage: 1,
includeTotals: true,
fields: "fields",
includeFields: true,
userId: "user_id",
clientId: "client_id",
type: "public_key",
});
}
main();
curl --request GET \
--url https://{tenantDomain}/api/v2/device-credentials \
--header 'Authorization: Bearer <token>'
[
  {
    "id": "dcr_0000000000000001",
    "device_name": "iPhone Mobile Safari UI/WKWebView",
    "device_id": "550e8400-e29b-41d4-a716-446655440000",
    "user_id": "usr_5457edea1b8f33391a000004",
    "client_id": "AaiyAPdpYdesoKnqjj8HJqRn4T5titww"
  }
]

Autorisations

Authorization
string
header
requis

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

Paramètres de requête

page
integer

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

Plage requise: x >= 0
per_page
integer

Number of results per page. There is a maximum of 1000 results allowed from this endpoint.

Plage requise: 1 <= x <= 100
include_totals
boolean

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

fields
string

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

include_fields
boolean

Whether specified fields are to be included (true) or excluded (false).

user_id
string

user_id of the devices to retrieve.

client_id
string

client_id of the devices to retrieve.

type
enum<string>

Type of credentials to retrieve. Must be public_key, refresh_token or rotating_refresh_token. The property will default to refresh_token when paging is requested

Options disponibles:
public_key,
refresh_token,
rotating_refresh_token

Réponse

Device credentials successfully retrieved.

id
string
défaut:dcr_0000000000000001

ID of this device.

device_name
string
défaut:iPhone Mobile Safari UI/WKWebView

User agent for this device

device_id
string
défaut:550e8400-e29b-41d4-a716-446655440000

Unique identifier for the device. NOTE: This field is generally not populated for refresh_tokens and rotating_refresh_tokens

type
enum<string>

Type of credential. Can be public_key, refresh_token, or rotating_refresh_token.

Options disponibles:
public_key,
refresh_token,
rotating_refresh_token
user_id
string
défaut:usr_5457edea1b8f33391a000004

user_id this credential is associated with.

client_id
string
défaut:AaiyAPdpYdesoKnqjj8HJqRn4T5titww

client_id of the client (application) this credential is for.