TypeScript
import { MyAccountClient } from "@auth0/myaccount-js";
async function main() {
const client = new MyAccountClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.consents.decide("consent_id", {
decision: "approve",
});
}
main();import { MyAccountClient } from "@auth0/myaccount-js";
async function main() {
const client = new MyAccountClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.consents.decide("consent_id", {
decision: "approve",
});
}
main();
curl --request POST \
--url https://{host}/me/v1/consents/{consent_id}/decide \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"decision": "approve"
}
'import requests
url = "https://{host}/me/v1/consents/{consent_id}/decide"
payload = { "decision": "approve" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/me/v1/consents/{consent_id}/decide",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'decision' => 'approve'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/me/v1/consents/{consent_id}/decide"
payload := strings.NewReader("{\n \"decision\": \"approve\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/me/v1/consents/{consent_id}/decide")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"decision\": \"approve\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/me/v1/consents/{consent_id}/decide")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"decision\": \"approve\"\n}"
response = http.request(request)
puts response.read_body{
"consent_id": "<string>",
"status": "approved"
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}同意を決定する
認証済みユーザーの保留中の同意を承認または拒否します。signature と kid が指定されている場合、同意サービスは決定を記録する前に、ユーザーが登録した同意の署名鍵を使用して JWS 署名を検証します。
POST
https://{host}/me/v1
/
consents
/
{consent_id}
/
decide
TypeScript
import { MyAccountClient } from "@auth0/myaccount-js";
async function main() {
const client = new MyAccountClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.consents.decide("consent_id", {
decision: "approve",
});
}
main();import { MyAccountClient } from "@auth0/myaccount-js";
async function main() {
const client = new MyAccountClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.consents.decide("consent_id", {
decision: "approve",
});
}
main();
curl --request POST \
--url https://{host}/me/v1/consents/{consent_id}/decide \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"decision": "approve"
}
'import requests
url = "https://{host}/me/v1/consents/{consent_id}/decide"
payload = { "decision": "approve" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/me/v1/consents/{consent_id}/decide",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'decision' => 'approve'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/me/v1/consents/{consent_id}/decide"
payload := strings.NewReader("{\n \"decision\": \"approve\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/me/v1/consents/{consent_id}/decide")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"decision\": \"approve\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/me/v1/consents/{consent_id}/decide")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"decision\": \"approve\"\n}"
response = http.request(request)
puts response.read_body{
"consent_id": "<string>",
"status": "approved"
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}ヘッダー
分散トレース全体でリクエストを関連付けるために使用するW3C Trace Contextヘッダーです。指定された場合は受信トレースが継続され、新しい子スパンがレスポンスのtraceparentヘッダーで返されます。トレースIDはテナントログのreferences.trace_idにも表示されます。形式が不正な値は無視されます。
ボディ
application/json
保留中の同意リクエストに対するユーザーの決定。