メインコンテンツへスキップ
GET
https://{tenantDomain}/api/v2
/
device-credentials
Go
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,
    )
}
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>'
import requests

url = "https://{tenantDomain}/api/v2/device-credentials"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/device-credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.get("https://{tenantDomain}/api/v2/device-credentials")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/device-credentials")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
[
  {
    "id": "dcr_0000000000000001",
    "device_name": "iPhone Mobile Safari UI/WKWebView",
    "device_id": "550e8400-e29b-41d4-a716-446655440000",
    "user_id": "usr_5457edea1b8f33391a000004",
    "client_id": "AaiyAPdpYdesoKnqjj8HJqRn4T5titww"
  }
]

承認

Authorization
string
header
必須

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

クエリパラメータ

page
integer

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

必須範囲: x >= 0
per_page
integer

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

必須範囲: 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

利用可能なオプション:
public_key,
refresh_token,
rotating_refresh_token

レスポンス

Device credentials successfully retrieved.

id
string
デフォルト:dcr_0000000000000001

ID of this device.

device_name
string
デフォルト:iPhone Mobile Safari UI/WKWebView

User agent for this device

device_id
string
デフォルト: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.

利用可能なオプション:
public_key,
refresh_token,
rotating_refresh_token
user_id
string
デフォルト:usr_5457edea1b8f33391a000004

user_id this credential is associated with.

client_id
string
デフォルト:AaiyAPdpYdesoKnqjj8HJqRn4T5titww

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