Account
Create a partner session
Exchanges partner app credentials + a trader API key for a short-lived
bearer token. The key identifies the trader; an optional email must match
its owner. With firm, the token only acknowledges the trader’s accounts at
that firm: accounts at other firms are invisible to the session, for reads,
writes and WebSocket events alike. Without firm, the session covers the
trader’s accounts at every firm.
POST
/
trade
/
partner
/
session
Create a partner session
curl --request POST \
--url https://api.hyperprop.com/trade/partner/session \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_secret": "<string>",
"email": "<string>",
"firm": "<string>"
}
'import requests
url = "https://api.hyperprop.com/trade/partner/session"
payload = {
"api_key": "<string>",
"app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_secret": "<string>",
"email": "<string>",
"firm": "<string>"
}
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({
api_key: '<string>',
app_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
app_secret: '<string>',
email: '<string>',
firm: '<string>'
})
};
fetch('https://api.hyperprop.com/trade/partner/session', 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.hyperprop.com/trade/partner/session",
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([
'api_key' => '<string>',
'app_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'app_secret' => '<string>',
'email' => '<string>',
'firm' => '<string>'
]),
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.hyperprop.com/trade/partner/session"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"app_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app_secret\": \"<string>\",\n \"email\": \"<string>\",\n \"firm\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://api.hyperprop.com/trade/partner/session")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"app_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app_secret\": \"<string>\",\n \"email\": \"<string>\",\n \"firm\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/partner/session")
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 \"api_key\": \"<string>\",\n \"app_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app_secret\": \"<string>\",\n \"email\": \"<string>\",\n \"firm\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": null,
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"account_ids": [
"b2e571d1-54b6-42a5-a09a-ccd543594567",
"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a"
],
"expires_in": 900,
"organization_id": null,
"organization_name": null,
"organization_slug": null,
"organizations": [
{
"account_ids": [
"b2e571d1-54b6-42a5-a09a-ccd543594567"
],
"id": "7e8f9a0b-4c5d-4e6f-8a9b-0c1d2e3f4a51",
"name": "FakePropFirm",
"slug": "fakepropfirm"
},
{
"account_ids": [
"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a"
],
"id": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"name": "OtherPropFirm",
"slug": "otherpropfirm"
}
],
"token_type": "Bearer"
},
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}Body
application/json
Request body for the partner session exchange.
Response
Session created
⌘I
Create a partner session
curl --request POST \
--url https://api.hyperprop.com/trade/partner/session \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_secret": "<string>",
"email": "<string>",
"firm": "<string>"
}
'import requests
url = "https://api.hyperprop.com/trade/partner/session"
payload = {
"api_key": "<string>",
"app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_secret": "<string>",
"email": "<string>",
"firm": "<string>"
}
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({
api_key: '<string>',
app_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
app_secret: '<string>',
email: '<string>',
firm: '<string>'
})
};
fetch('https://api.hyperprop.com/trade/partner/session', 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.hyperprop.com/trade/partner/session",
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([
'api_key' => '<string>',
'app_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'app_secret' => '<string>',
'email' => '<string>',
'firm' => '<string>'
]),
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.hyperprop.com/trade/partner/session"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"app_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app_secret\": \"<string>\",\n \"email\": \"<string>\",\n \"firm\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://api.hyperprop.com/trade/partner/session")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"app_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app_secret\": \"<string>\",\n \"email\": \"<string>\",\n \"firm\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/partner/session")
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 \"api_key\": \"<string>\",\n \"app_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app_secret\": \"<string>\",\n \"email\": \"<string>\",\n \"firm\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": null,
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"account_ids": [
"b2e571d1-54b6-42a5-a09a-ccd543594567",
"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a"
],
"expires_in": 900,
"organization_id": null,
"organization_name": null,
"organization_slug": null,
"organizations": [
{
"account_ids": [
"b2e571d1-54b6-42a5-a09a-ccd543594567"
],
"id": "7e8f9a0b-4c5d-4e6f-8a9b-0c1d2e3f4a51",
"name": "FakePropFirm",
"slug": "fakepropfirm"
},
{
"account_ids": [
"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a"
],
"id": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"name": "OtherPropFirm",
"slug": "otherpropfirm"
}
],
"token_type": "Bearer"
},
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}