Java (SDK)
package hello.world;
import java.lang.Exception;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.Oauth2AuthorizeConfirmRequest;
import org.openapis.openapi.models.operations.Oauth2AuthorizeConfirmResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
Oauth2AuthorizeConfirmRequest req = Oauth2AuthorizeConfirmRequest.builder()
.nextStepAuthId("auth_confirm_456def")
.build();
Oauth2AuthorizeConfirmResponse res = sdk.oAuth2().authorizeConfirm()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}curl --request POST \
--url https://api.tradearies.dev/v1/oauth2/authorize/confirm \
--header 'Content-Type: application/json' \
--data '
{
"next_step_auth_id": "auth_confirm_456def"
}
'import requests
url = "https://api.tradearies.dev/v1/oauth2/authorize/confirm"
payload = { "next_step_auth_id": "auth_confirm_456def" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({next_step_auth_id: 'auth_confirm_456def'})
};
fetch('https://api.tradearies.dev/v1/oauth2/authorize/confirm', 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://api.tradearies.dev/v1/oauth2/authorize/confirm",
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([
'next_step_auth_id' => 'auth_confirm_456def'
]),
CURLOPT_HTTPHEADER => [
"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://api.tradearies.dev/v1/oauth2/authorize/confirm"
payload := strings.NewReader("{\n \"next_step_auth_id\": \"auth_confirm_456def\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/oauth2/authorize/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"next_step_auth_id\": \"auth_confirm_456def\"\n}"
response = http.request(request)
puts response.read_body{
"code": "auth_code_abc123xyz789def456",
"redirect_uri": "https://yourapp.com/callback"
}{
"error": "Invalid authorization session",
"codes": [
{
"code": "INVALID_AUTH_SESSION",
"field": "next_step_auth_id",
"description": "The authorization session is invalid or has expired"
}
]
}OAuth2
OAuth2 Authorize Confirm
Confirms user authorization and generates authorization code. This endpoint completes the authorization flow by confirming the user’s consent and generating an authorization code. The authorization code can then be exchanged for access and refresh tokens using the /v1/oauth2/token endpoint.
POST
/
v1
/
oauth2
/
authorize
/
confirm
Java (SDK)
package hello.world;
import java.lang.Exception;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.Oauth2AuthorizeConfirmRequest;
import org.openapis.openapi.models.operations.Oauth2AuthorizeConfirmResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
Oauth2AuthorizeConfirmRequest req = Oauth2AuthorizeConfirmRequest.builder()
.nextStepAuthId("auth_confirm_456def")
.build();
Oauth2AuthorizeConfirmResponse res = sdk.oAuth2().authorizeConfirm()
.request(req)
.call();
if (res.object().isPresent()) {
// handle response
}
}
}curl --request POST \
--url https://api.tradearies.dev/v1/oauth2/authorize/confirm \
--header 'Content-Type: application/json' \
--data '
{
"next_step_auth_id": "auth_confirm_456def"
}
'import requests
url = "https://api.tradearies.dev/v1/oauth2/authorize/confirm"
payload = { "next_step_auth_id": "auth_confirm_456def" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({next_step_auth_id: 'auth_confirm_456def'})
};
fetch('https://api.tradearies.dev/v1/oauth2/authorize/confirm', 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://api.tradearies.dev/v1/oauth2/authorize/confirm",
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([
'next_step_auth_id' => 'auth_confirm_456def'
]),
CURLOPT_HTTPHEADER => [
"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://api.tradearies.dev/v1/oauth2/authorize/confirm"
payload := strings.NewReader("{\n \"next_step_auth_id\": \"auth_confirm_456def\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/oauth2/authorize/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"next_step_auth_id\": \"auth_confirm_456def\"\n}"
response = http.request(request)
puts response.read_body{
"code": "auth_code_abc123xyz789def456",
"redirect_uri": "https://yourapp.com/callback"
}{
"error": "Invalid authorization session",
"codes": [
{
"code": "INVALID_AUTH_SESSION",
"field": "next_step_auth_id",
"description": "The authorization session is invalid or has expired"
}
]
}Body
application/json
Authorization session ID from previous step (/v1/oauth2/authorize or /v1/oauth2/authorize/mfa)
Example:
"auth_confirm_456def"
Was this page helpful?
⌘I