Finaliser une requête de compte connecté
curl --request POST \
--url https://{host}/me/v1/connected-accounts/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auth_session": "<string>",
"connect_code": "<string>",
"redirect_uri": "<string>",
"code_verifier": "<string>"
}
'import requests
url = "https://{host}/me/v1/connected-accounts/complete"
payload = {
"auth_session": "<string>",
"connect_code": "<string>",
"redirect_uri": "<string>",
"code_verifier": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auth_session: '<string>',
connect_code: '<string>',
redirect_uri: '<string>',
code_verifier: '<string>'
})
};
fetch('https://{host}/me/v1/connected-accounts/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/me/v1/connected-accounts/complete",
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([
'auth_session' => '<string>',
'connect_code' => '<string>',
'redirect_uri' => '<string>',
'code_verifier' => '<string>'
]),
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/connected-accounts/complete"
payload := strings.NewReader("{\n \"auth_session\": \"<string>\",\n \"connect_code\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"code_verifier\": \"<string>\"\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/connected-accounts/complete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"auth_session\": \"<string>\",\n \"connect_code\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"code_verifier\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/me/v1/connected-accounts/complete")
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 \"auth_session\": \"<string>\",\n \"connect_code\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"code_verifier\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_type": "offline",
"connection": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"scopes": [
"<string>"
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}Finaliser la demande de compte connecté
deprecated
Terminer un flux d’autorisation démarré précédemment pour lier le compte de l’utilisateur authentifié à un fournisseur d’identité externe.
POST
https://{host}/me/v1
/
connected-accounts
/
complete
Finaliser une requête de compte connecté
curl --request POST \
--url https://{host}/me/v1/connected-accounts/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auth_session": "<string>",
"connect_code": "<string>",
"redirect_uri": "<string>",
"code_verifier": "<string>"
}
'import requests
url = "https://{host}/me/v1/connected-accounts/complete"
payload = {
"auth_session": "<string>",
"connect_code": "<string>",
"redirect_uri": "<string>",
"code_verifier": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auth_session: '<string>',
connect_code: '<string>',
redirect_uri: '<string>',
code_verifier: '<string>'
})
};
fetch('https://{host}/me/v1/connected-accounts/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/me/v1/connected-accounts/complete",
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([
'auth_session' => '<string>',
'connect_code' => '<string>',
'redirect_uri' => '<string>',
'code_verifier' => '<string>'
]),
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/connected-accounts/complete"
payload := strings.NewReader("{\n \"auth_session\": \"<string>\",\n \"connect_code\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"code_verifier\": \"<string>\"\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/connected-accounts/complete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"auth_session\": \"<string>\",\n \"connect_code\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"code_verifier\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/me/v1/connected-accounts/complete")
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 \"auth_session\": \"<string>\",\n \"connect_code\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"code_verifier\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_type": "offline",
"connection": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"scopes": [
"<string>"
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}Autorisations
Les jetons Bearer et DPoP sont pris en charge selon la configuration de l’API
Corps
application/json
L’identifiant de session d’authentification
Maximum string length:
64Le code d’autorisation renvoyé par le flux de connexion
Required string length:
1 - 46Le Redirect URI utilisé dans la requête d’origine
Maximum string length:
2048Le code verifier PKCE
Required string length:
43 - 128Réponse
Requête de compte connecté terminée avec succès
Le type d’accès, toujours « offline »
Options disponibles:
offline Le nom de la connexion
Chaîne de date ISO indiquant la date de création du compte connecté
L’identifiant unique du compte connecté
Chaîne de date ISO indiquant la date d’expiration du refresh token (facultatif)
Tableau des scopes accordés
⌘I