メインコンテンツへスキップ
GET
https://{tenantDomain}/api/v2
/
users
/
{id}
/
enrollments
Go
package example

import (
    context "context"

    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>",
        ),
    )
    client.Users.Enrollments.Get(
        context.TODO(),
        "id",
    )
}
import { ManagementClient } from "auth0";

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

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.users.enrollments.get("id");
}
main();
curl --request GET \
  --url https://{tenantDomain}/api/v2/users/{id}/enrollments \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://{tenantDomain}/api/v2/users/{id}/enrollments"

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/users/{id}/enrollments",
  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/users/{id}/enrollments")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/users/{id}/enrollments")

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": "<string>",
    "type": "<string>",
    "name": "<string>",
    "identifier": "<string>",
    "phone_number": "<string>",
    "enrolled_at": "2023-11-07T05:31:56Z",
    "last_auth": "2023-11-07T05:31:56Z"
  }
]

承認

Authorization
string
header
必須

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

パスパラメータ

id
string
必須

ID of the user to list enrollments for.

レスポンス

Enrollments successfully retrieved.

id
string

ID of this enrollment.

status
enum<string>

Status of this enrollment. Can be pending or confirmed.

利用可能なオプション:
pending,
confirmed
type
string

Type of enrollment.

name
string

Name of enrollment (usually phone number).

Maximum string length: 20
identifier
string

Device identifier (usually phone identifier) of this enrollment.

phone_number
string

Phone number for this enrollment.

auth_method
enum<string>

Authentication method for this enrollment. Can be authenticator, guardian, sms, webauthn-roaming, or webauthn-platform.

利用可能なオプション:
authenticator,
guardian,
sms,
webauthn-platform,
webauthn-roaming
enrolled_at
string<date-time>

Start date and time of this enrollment.

last_auth
string<date-time>

Last authentication date and time of this enrollment.