Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
guardian
/
enrollments
/
{id}
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.Guardian.Enrollments.Get(
        context.TODO(),
        "id",
    )
}
import { ManagementClient } from "auth0";

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

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

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

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

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

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": "dev_0000000000000001",
  "status": "pending",
  "name": "iPhone 7",
  "identifier": "76dc-a90c-a88c-a90c-a88c-a88c-a90c",
  "phone_number": "+1 999999999999",
  "enrolled_at": "2016-07-12T17:56:26.804Z",
  "last_auth": "2016-07-12T17:56:26.804Z"
}

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 enrollment to be retrieve.

Réponse

Enrollment successfully retrieved.

id
string
défaut:dev_0000000000000001
requis

ID for this enrollment.

status
enum<string>
défaut:pending

Status of this enrollment. Can be pending or confirmed.

Options disponibles:
pending,
confirmed
name
string
défaut:iPhone 7

Device name (only for push notification).

Required string length: 1 - 20
Pattern: ^\+[0-9]{8, 20}
identifier
string
défaut:76dc-a90c-a88c-a90c-a88c-a88c-a90c

Device identifier. This is usually the phone identifier.

phone_number
string
défaut:+1 999999999999

Phone number.

enrolled_at
string
défaut:2016-07-12T17:56:26.804Z

Enrollment date and time.

last_auth
string
défaut:2016-07-12T17:56:26.804Z

Enrollment date and time.