TypeScript
// 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}/complete', {
method: 'POST',
headers: {
'content-type': 'application/json',
'x-trdrs-connect-frame': frameToken,
},
credentials: 'omit',
body: JSON.stringify({
"provider": "rithmic",
"accountNumber": "EVAL-7C21A9"
}),
})
const data = await res.json()curl -X POST 'https://app.trdrs.co/api/connect-link/sessions/{sessionId}/complete' \
-H "x-trdrs-connect-frame: $TRDRS_CONNECT_FRAME" \
-H 'content-type: application/json' \
-d '{"provider":"rithmic","accountNumber":"EVAL-7C21A9"}'import requests
url = "https://app.trdrs.co/api/connect-link/sessions/{sessionId}/complete"
payload = {
"provider": "rithmic",
"accountNumber": "EVAL-7C21A9"
}
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}/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([
'provider' => 'rithmic',
'accountNumber' => 'EVAL-7C21A9'
]),
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}/complete"
payload := strings.NewReader("{\n \"provider\": \"rithmic\",\n \"accountNumber\": \"EVAL-7C21A9\"\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}/complete")
.header("x-trdrs-connect-frame", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"rithmic\",\n \"accountNumber\": \"EVAL-7C21A9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/connect-link/sessions/{sessionId}/complete")
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 \"provider\": \"rithmic\",\n \"accountNumber\": \"EVAL-7C21A9\"\n}"
response = http.request(request)
puts response.read_body{
"session": {
"id": "00000000-0000-0000-0000-000000000001",
"state": "connected",
"accountId": "4f1c2a9b8e7d6c5b4a39281706f5e4d3"
}
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Hosted Connect's own routes
Complete a Connect provider login
Completes the Connect link’s session once the trader has signed in to the provider. trdrs looks the account up in the trader’s own connected accounts, so you can’t name an account they don’t hold. It needs the frame session the mount opened for the session’s trader. Preview: served on the sandbox, where it is free.
POST
/
api
/
connect-link
/
sessions
/
{sessionId}
/
complete
TypeScript
// 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}/complete', {
method: 'POST',
headers: {
'content-type': 'application/json',
'x-trdrs-connect-frame': frameToken,
},
credentials: 'omit',
body: JSON.stringify({
"provider": "rithmic",
"accountNumber": "EVAL-7C21A9"
}),
})
const data = await res.json()curl -X POST 'https://app.trdrs.co/api/connect-link/sessions/{sessionId}/complete' \
-H "x-trdrs-connect-frame: $TRDRS_CONNECT_FRAME" \
-H 'content-type: application/json' \
-d '{"provider":"rithmic","accountNumber":"EVAL-7C21A9"}'import requests
url = "https://app.trdrs.co/api/connect-link/sessions/{sessionId}/complete"
payload = {
"provider": "rithmic",
"accountNumber": "EVAL-7C21A9"
}
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}/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([
'provider' => 'rithmic',
'accountNumber' => 'EVAL-7C21A9'
]),
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}/complete"
payload := strings.NewReader("{\n \"provider\": \"rithmic\",\n \"accountNumber\": \"EVAL-7C21A9\"\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}/complete")
.header("x-trdrs-connect-frame", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"rithmic\",\n \"accountNumber\": \"EVAL-7C21A9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/connect-link/sessions/{sessionId}/complete")
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 \"provider\": \"rithmic\",\n \"accountNumber\": \"EVAL-7C21A9\"\n}"
response = http.request(request)
puts response.read_body{
"session": {
"id": "00000000-0000-0000-0000-000000000001",
"state": "connected",
"accountId": "4f1c2a9b8e7d6c5b4a39281706f5e4d3"
}
}{
"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 link's trader, lasting 30 minutes at most. Hosted Connect holds it in memory and sends it itself. An API key or a Venue key cannot reach a route secured this way.
Path Parameters
Body
application/json
Response
Success. The response is sent with Cache-Control: no-store, so don't cache it.
The response is of type object.