Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
organizations
/
{id}
/
invitations
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"
    organizations "github.com/auth0/go-auth0/management/management/organizations"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &organizations.ListOrganizationInvitationsRequestParameters{
        Page: management.Int(
            1,
        ),
        PerPage: management.Int(
            1,
        ),
        IncludeTotals: management.Bool(
            true,
        ),
        Fields: management.String(
            "fields",
        ),
        IncludeFields: management.Bool(
            true,
        ),
        Sort: management.String(
            "sort",
        ),
    }
    client.Organizations.Invitations.List(
        context.TODO(),
        "id",
        request,
    )
}
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.invitations.list("id", {
page: 1,
perPage: 1,
includeTotals: true,
fields: "fields",
includeFields: true,
sort: "sort",
});
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.invitations.list("id", {
page: 1,
perPage: 1,
includeTotals: true,
fields: "fields",
includeFields: true,
sort: "sort",
});
}
main();
curl --request GET \
--url https://{tenantDomain}/api/v2/organizations/{id}/invitations \
--header 'Authorization: Bearer <token>'
import requests

url = "https://{tenantDomain}/api/v2/organizations/{id}/invitations"

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

url = URI("https://{tenantDomain}/api/v2/organizations/{id}/invitations")

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": "uinv_0000000000000001",
    "organization_id": "<string>",
    "inviter": {
      "name": "Jane Doe"
    },
    "invitee": {
      "email": "john.doe@gmail.com"
    },
    "invitation_url": "https://mycompany.org/login?invitation=f81dWWYW6gzGGicxT8Ha0txBkGNcAcYr&organization=org_0000000000000001&organization_name=acme",
    "created_at": "2020-08-20T19:10:06.299Z",
    "expires_at": "2020-08-27T19:10:06.299Z",
    "client_id": "AaiyAPdpYdesoKnqjj8HJqRn4T5titww",
    "connection_id": "con_0000000000000001",
    "app_metadata": {},
    "user_metadata": {},
    "roles": [
      "<string>"
    ],
    "ticket_id": "<string>"
  }
]

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

Organization identifier.

Maximum string length: 50

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. Defaults to 50.

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

When true, return results inside an object that also contains the start and limit. When false (default), a direct array of results is returned. We do not yet support returning the total invitations count.

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). Defaults to true.

sort
string

Field to sort by. Use field:order where order is 1 for ascending and -1 for descending Defaults to created_at:-1.

Réponse

Invitations successfully retrieved.

id
string<user-invitation-id>
défaut:uinv_0000000000000001

The id of the user invitation.

organization_id
string<organization-id>

Organization identifier.

Maximum string length: 50
inviter
object
invitee
object
invitation_url
string<strict-https-uri>
défaut:https://mycompany.org/login?invitation=f81dWWYW6gzGGicxT8Ha0txBkGNcAcYr&organization=org_0000000000000001&organization_name=acme

The invitation url to be send to the invitee.

created_at
string<date-time>
défaut:2020-08-20T19:10:06.299Z

The ISO 8601 formatted timestamp representing the creation time of the invitation.

expires_at
string<date-time>
défaut:2020-08-27T19:10:06.299Z

The ISO 8601 formatted timestamp representing the expiration time of the invitation.

client_id
string<client-id>
défaut:AaiyAPdpYdesoKnqjj8HJqRn4T5titww

Auth0 client ID. Used to resolve the application's login initiation endpoint.

connection_id
string<connection-id>
défaut:con_0000000000000001

The id of the connection to force invitee to authenticate with.

app_metadata
object

Data related to the user that does affect the application's core functionality.

user_metadata
object

Data related to the user that does not affect the application's core functionality.

roles
string<role-id>[]

List of roles IDs to associated with the user.

Minimum array length: 1
ticket_id
string<ticket-id>

The id of the invitation ticket