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"
users "github.com/auth0/go-auth0/management/management/users"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &users.ListUserOrganizationsRequestParameters{
Page: management.Int(
1,
),
PerPage: management.Int(
1,
),
IncludeTotals: management.Bool(
true,
),
}
client.Users.Organizations.List(
context.TODO(),
"id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.organizations.list("id", {
page: 1,
perPage: 1,
includeTotals: true,
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.organizations.list("id", {
page: 1,
perPage: 1,
includeTotals: true,
});
}
main();curl --request GET \
--url https://{tenantDomain}/api/v2/users/{id}/organizations \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenantDomain}/api/v2/users/{id}/organizations"
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}/organizations",
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}/organizations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/users/{id}/organizations")
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[
{
"branding": {
"colors": {
"page_background": "<string>",
"primary": "<string>"
},
"logo_url": "<string>"
},
"display_name": "Acme Users",
"id": "<string>",
"metadata": {},
"name": "organization-1",
"token_quota": {
"client_credentials": {
"enforce": true,
"per_day": 1073741824,
"per_hour": 1073741824
}
}
}
]ユーザーが所属する組織を取得
指定したユーザーの現在の組織メンバーシップ一覧を取得します。ユーザーはユーザー ID で指定する必要があります。詳細については、Auth0 組織を参照してください。
GET
https://{tenantDomain}/api/v2
/
users
/
{id}
/
organizations
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"
users "github.com/auth0/go-auth0/management/management/users"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &users.ListUserOrganizationsRequestParameters{
Page: management.Int(
1,
),
PerPage: management.Int(
1,
),
IncludeTotals: management.Bool(
true,
),
}
client.Users.Organizations.List(
context.TODO(),
"id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.organizations.list("id", {
page: 1,
perPage: 1,
includeTotals: true,
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.organizations.list("id", {
page: 1,
perPage: 1,
includeTotals: true,
});
}
main();curl --request GET \
--url https://{tenantDomain}/api/v2/users/{id}/organizations \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenantDomain}/api/v2/users/{id}/organizations"
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}/organizations",
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}/organizations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/users/{id}/organizations")
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[
{
"branding": {
"colors": {
"page_background": "<string>",
"primary": "<string>"
},
"logo_url": "<string>"
},
"display_name": "Acme Users",
"id": "<string>",
"metadata": {},
"name": "organization-1",
"token_quota": {
"client_credentials": {
"enforce": true,
"per_day": 1073741824,
"per_hour": 1073741824
}
}
}
]承認
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
パスパラメータ
組織を取得する対象ユーザーの ID。
クエリパラメータ
返される結果のページ番号。最初のページは 0 です。
必須範囲:
0 <= x <= 1000ページあたりの結果数。既定値は 50 です。
必須範囲:
1 <= x <= 100合計結果数を含むオブジェクト内に結果を返す場合は true、結果の配列を直接返す場合は false(既定値)。
レスポンス
組織が正常に取得されました。
- object[]
- object
テーマは、ログインページのスタイルを定義します。
Show child attributes
Show child attributes
この組織のフレンドリ名。
Required string length:
1 - 255組織の識別子。
Maximum string length:
50組織に関連付けられたメタデータ。文字列値を持つオブジェクト形式です(最大 255 文字)。メタデータプロパティは最大 25 個まで指定できます。
Show child attributes
Show child attributes
この組織の名前。
Required string length:
1 - 50Show child attributes
Show child attributes
⌘I