Complete a connected account request
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{
"id": "<string>",
"connection": "<string>",
"access_type": "offline",
"created_at": "2023-11-07T05:31:56Z",
"scopes": [
"<string>"
],
"expires_at": "2023-11-07T05:31:56Z"
}{
"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>"
}
]
}Complete a connected account request
Complete a previously started authorization flow to link the authenticated user’s account with an external identity provider.
POST
https://{host}/me/v1
/
connected-accounts
/
complete
Complete a connected account request
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{
"id": "<string>",
"connection": "<string>",
"access_type": "offline",
"created_at": "2023-11-07T05:31:56Z",
"scopes": [
"<string>"
],
"expires_at": "2023-11-07T05:31:56Z"
}{
"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>"
}
]
}Autorisations
Bearer and DPoP tokens are supported depending on the API configuration
Corps
application/json
The authentication session identifier
Maximum string length:
64The authorization code returned from the connect flow
Required string length:
1 - 46The redirect URI used in the original request
Maximum string length:
2048The PKCE code verifier
Required string length:
43 - 128Réponse
Connected account request completed successfully
The unique identifier of the connected account
The connection name
The access type, always 'offline'
Options disponibles:
offline ISO date string of when the connected account was created
Array of scopes granted
ISO date string of when the refresh token expires (optional)
⌘I