// Runs inside hosted Connect. frameToken is the frame session its sign-in returned, held in memory only.
const res = await fetch('https://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish', {
method: 'POST',
headers: {
'content-type': 'application/json',
'x-trdrs-connect-frame': frameToken,
},
credentials: 'omit',
body: JSON.stringify({
"pending": "pending_example"
}),
})
const data = await res.json()curl -X POST 'https://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish' \
-H "x-trdrs-connect-frame: $TRDRS_CONNECT_FRAME" \
-H 'content-type: application/json' \
-d '{"pending":"pending_example"}'import requests
url = "https://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish"
payload = { "pending": "pending_example" }
headers = {
"x-trdrs-connect-frame": "<api-key>",
"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://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish",
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([
'pending' => 'pending_example'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-trdrs-connect-frame: <api-key>"
],
]);
$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://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish"
payload := strings.NewReader("{\n \"pending\": \"pending_example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-trdrs-connect-frame", "<api-key>")
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://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish")
.header("x-trdrs-connect-frame", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pending\": \"pending_example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-trdrs-connect-frame"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pending\": \"pending_example\"\n}"
response = http.request(request)
puts response.read_body{
"accountNumber": "5WT00001"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Finish a provider sign-in window
Connects the provider account the sign-in window brought back, for the frame session that started it. The pending value is single-use and lasts 10 minutes. Use the account number it returns to complete the session. Preview: served on the sandbox to every venue, and production availability is arranged when a venue qualifies. Trading API keys and Partner keys do not authorize these routes.
// Runs inside hosted Connect. frameToken is the frame session its sign-in returned, held in memory only.
const res = await fetch('https://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish', {
method: 'POST',
headers: {
'content-type': 'application/json',
'x-trdrs-connect-frame': frameToken,
},
credentials: 'omit',
body: JSON.stringify({
"pending": "pending_example"
}),
})
const data = await res.json()curl -X POST 'https://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish' \
-H "x-trdrs-connect-frame: $TRDRS_CONNECT_FRAME" \
-H 'content-type: application/json' \
-d '{"pending":"pending_example"}'import requests
url = "https://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish"
payload = { "pending": "pending_example" }
headers = {
"x-trdrs-connect-frame": "<api-key>",
"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://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish",
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([
'pending' => 'pending_example'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-trdrs-connect-frame: <api-key>"
],
]);
$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://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish"
payload := strings.NewReader("{\n \"pending\": \"pending_example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-trdrs-connect-frame", "<api-key>")
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://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish")
.header("x-trdrs-connect-frame", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pending\": \"pending_example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/connect-link/sessions/{sessionId}/oauth/{provider}/finish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-trdrs-connect-frame"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pending\": \"pending_example\"\n}"
response = http.request(request)
puts response.read_body{
"accountNumber": "5WT00001"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Authorizations
The frame session the mount opens for a Connect session's trader, lasting 30 minutes at most. Hosted Connect sends it; your page and your server never hold it. An API key or a Venue key cannot reach a route secured this way.
Path Parameters
A provider that signs traders in on its own page.
tastytrade Body
The one-time value the sign-in window handed back.
Response
Success. The response is sent with Cache-Control: no-store, so don't cache it.
The connected account number at the provider.