curl --request POST \
--url https://api.riskportal.activeviam.com/api/LegacyPosition/PositionUpload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"$type": "Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core",
"market_data_environment_name": "Example market data",
"provider_id": "<string>",
"positions": [
{
"$type": "Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core",
"book": "<string>",
"contract_size": 123,
"quantity": 123,
"quantity_traded": 123,
"quantity_currency": "<string>",
"buy_sell": "<string>",
"tradable_id": "<string>",
"trade_action": "<string>",
"client_transaction_id": "<string>",
"counterparty": "<string>",
"structure": "<string>",
"leg": "<string>",
"stamp_derivitec_id": true,
"traded_price_today": 123,
"traded_price_previous": 123,
"dealing_bank": "<string>",
"notes": "<string>",
"trade_date": "2023-11-07T05:31:56Z",
"traded_notional": 123,
"team": "<string>",
"split_by_reporting_currency": true,
"dealer_name": "<string>",
"counterparty_alias": "<string>",
"client": "<string>",
"reference": "<string>",
"product_type": "<string>",
"business_unit": "<string>",
"sub_business_unit": "<string>",
"counterparty_account": "<string>",
"strategy": "<string>",
"entity": "<string>",
"client_tradable_id": "<string>",
"string_label1": "<string>",
"string_label2": "<string>",
"string_label3": "<string>",
"string_label4": "<string>",
"string_label5": "<string>",
"string_label6": "<string>",
"string_label7": "<string>",
"string_label8": "<string>",
"string_label9": "<string>",
"string_label10": "<string>",
"string_label11": "<string>",
"string_label12": "<string>",
"string_label13": "<string>",
"string_label14": "<string>",
"string_label15": "<string>",
"string_label16": "<string>",
"string_label17": "<string>",
"string_label18": "<string>",
"string_label19": "<string>",
"string_label20": "<string>",
"string_label21": "<string>",
"string_label22": "<string>",
"string_label23": "<string>",
"string_label24": "<string>",
"string_label25": "<string>",
"string_label26": "<string>",
"string_label27": "<string>",
"string_label28": "<string>",
"string_label29": "<string>",
"string_label30": "<string>",
"decimal_label1": 123,
"decimal_label2": 123,
"decimal_label3": 123,
"decimal_label4": 123,
"decimal_label5": 123,
"decimal_label6": 123,
"decimal_label7": 123,
"decimal_label8": 123,
"decimal_label9": 123,
"decimal_label10": 123,
"date_label1": "2023-11-07T05:31:56Z",
"date_label2": "2023-11-07T05:31:56Z",
"contract": {
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"calendar_name": "<string>",
"coupon_rate": 123,
"end_to_end": true,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"initial_fx_rate": 123
}
}
],
"create_missing_books": true,
"use_best_effort": true
}
'import requests
url = "https://api.riskportal.activeviam.com/api/LegacyPosition/PositionUpload"
payload = {
"$type": "Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core",
"market_data_environment_name": "Example market data",
"provider_id": "<string>",
"positions": [
{
"$type": "Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core",
"book": "<string>",
"contract_size": 123,
"quantity": 123,
"quantity_traded": 123,
"quantity_currency": "<string>",
"buy_sell": "<string>",
"tradable_id": "<string>",
"trade_action": "<string>",
"client_transaction_id": "<string>",
"counterparty": "<string>",
"structure": "<string>",
"leg": "<string>",
"stamp_derivitec_id": True,
"traded_price_today": 123,
"traded_price_previous": 123,
"dealing_bank": "<string>",
"notes": "<string>",
"trade_date": "2023-11-07T05:31:56Z",
"traded_notional": 123,
"team": "<string>",
"split_by_reporting_currency": True,
"dealer_name": "<string>",
"counterparty_alias": "<string>",
"client": "<string>",
"reference": "<string>",
"product_type": "<string>",
"business_unit": "<string>",
"sub_business_unit": "<string>",
"counterparty_account": "<string>",
"strategy": "<string>",
"entity": "<string>",
"client_tradable_id": "<string>",
"string_label1": "<string>",
"string_label2": "<string>",
"string_label3": "<string>",
"string_label4": "<string>",
"string_label5": "<string>",
"string_label6": "<string>",
"string_label7": "<string>",
"string_label8": "<string>",
"string_label9": "<string>",
"string_label10": "<string>",
"string_label11": "<string>",
"string_label12": "<string>",
"string_label13": "<string>",
"string_label14": "<string>",
"string_label15": "<string>",
"string_label16": "<string>",
"string_label17": "<string>",
"string_label18": "<string>",
"string_label19": "<string>",
"string_label20": "<string>",
"string_label21": "<string>",
"string_label22": "<string>",
"string_label23": "<string>",
"string_label24": "<string>",
"string_label25": "<string>",
"string_label26": "<string>",
"string_label27": "<string>",
"string_label28": "<string>",
"string_label29": "<string>",
"string_label30": "<string>",
"decimal_label1": 123,
"decimal_label2": 123,
"decimal_label3": 123,
"decimal_label4": 123,
"decimal_label5": 123,
"decimal_label6": 123,
"decimal_label7": 123,
"decimal_label8": 123,
"decimal_label9": 123,
"decimal_label10": 123,
"date_label1": "2023-11-07T05:31:56Z",
"date_label2": "2023-11-07T05:31:56Z",
"contract": {
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"calendar_name": "<string>",
"coupon_rate": 123,
"end_to_end": True,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"initial_fx_rate": 123
}
}
],
"create_missing_books": True,
"use_best_effort": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
$type: 'Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core',
market_data_environment_name: 'Example market data',
provider_id: '<string>',
positions: [
{
$type: 'Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core',
book: '<string>',
contract_size: 123,
quantity: 123,
quantity_traded: 123,
quantity_currency: '<string>',
buy_sell: '<string>',
tradable_id: '<string>',
trade_action: '<string>',
client_transaction_id: '<string>',
counterparty: '<string>',
structure: '<string>',
leg: '<string>',
stamp_derivitec_id: true,
traded_price_today: 123,
traded_price_previous: 123,
dealing_bank: '<string>',
notes: '<string>',
trade_date: '2023-11-07T05:31:56Z',
traded_notional: 123,
team: '<string>',
split_by_reporting_currency: true,
dealer_name: '<string>',
counterparty_alias: '<string>',
client: '<string>',
reference: '<string>',
product_type: '<string>',
business_unit: '<string>',
sub_business_unit: '<string>',
counterparty_account: '<string>',
strategy: '<string>',
entity: '<string>',
client_tradable_id: '<string>',
string_label1: '<string>',
string_label2: '<string>',
string_label3: '<string>',
string_label4: '<string>',
string_label5: '<string>',
string_label6: '<string>',
string_label7: '<string>',
string_label8: '<string>',
string_label9: '<string>',
string_label10: '<string>',
string_label11: '<string>',
string_label12: '<string>',
string_label13: '<string>',
string_label14: '<string>',
string_label15: '<string>',
string_label16: '<string>',
string_label17: '<string>',
string_label18: '<string>',
string_label19: '<string>',
string_label20: '<string>',
string_label21: '<string>',
string_label22: '<string>',
string_label23: '<string>',
string_label24: '<string>',
string_label25: '<string>',
string_label26: '<string>',
string_label27: '<string>',
string_label28: '<string>',
string_label29: '<string>',
string_label30: '<string>',
decimal_label1: 123,
decimal_label2: 123,
decimal_label3: 123,
decimal_label4: 123,
decimal_label5: 123,
decimal_label6: 123,
decimal_label7: 123,
decimal_label8: 123,
decimal_label9: 123,
decimal_label10: 123,
date_label1: '2023-11-07T05:31:56Z',
date_label2: '2023-11-07T05:31:56Z',
contract: {
$type: 'Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core',
identifier: '<string>',
currency: '<string>',
expiration_date: '2023-11-07T05:31:56Z',
asset_swap_spread: 123,
bond_identifier: {
$type: 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
code: '<string>',
market_identification_code: '<string>'
},
calendar_name: '<string>',
coupon_rate: 123,
end_to_end: true,
notional: 123,
payment_lag: 123,
period_str: '<string>',
rate_asset_name: '<string>',
roll_date: '2023-11-07T05:31:56Z',
start_date: '2023-11-07T05:31:56Z',
initial_fx_rate: 123
}
}
],
create_missing_books: true,
use_best_effort: true
})
};
fetch('https://api.riskportal.activeviam.com/api/LegacyPosition/PositionUpload', 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.riskportal.activeviam.com/api/LegacyPosition/PositionUpload",
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([
'$type' => 'Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core',
'market_data_environment_name' => 'Example market data',
'provider_id' => '<string>',
'positions' => [
[
'$type' => 'Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core',
'book' => '<string>',
'contract_size' => 123,
'quantity' => 123,
'quantity_traded' => 123,
'quantity_currency' => '<string>',
'buy_sell' => '<string>',
'tradable_id' => '<string>',
'trade_action' => '<string>',
'client_transaction_id' => '<string>',
'counterparty' => '<string>',
'structure' => '<string>',
'leg' => '<string>',
'stamp_derivitec_id' => true,
'traded_price_today' => 123,
'traded_price_previous' => 123,
'dealing_bank' => '<string>',
'notes' => '<string>',
'trade_date' => '2023-11-07T05:31:56Z',
'traded_notional' => 123,
'team' => '<string>',
'split_by_reporting_currency' => true,
'dealer_name' => '<string>',
'counterparty_alias' => '<string>',
'client' => '<string>',
'reference' => '<string>',
'product_type' => '<string>',
'business_unit' => '<string>',
'sub_business_unit' => '<string>',
'counterparty_account' => '<string>',
'strategy' => '<string>',
'entity' => '<string>',
'client_tradable_id' => '<string>',
'string_label1' => '<string>',
'string_label2' => '<string>',
'string_label3' => '<string>',
'string_label4' => '<string>',
'string_label5' => '<string>',
'string_label6' => '<string>',
'string_label7' => '<string>',
'string_label8' => '<string>',
'string_label9' => '<string>',
'string_label10' => '<string>',
'string_label11' => '<string>',
'string_label12' => '<string>',
'string_label13' => '<string>',
'string_label14' => '<string>',
'string_label15' => '<string>',
'string_label16' => '<string>',
'string_label17' => '<string>',
'string_label18' => '<string>',
'string_label19' => '<string>',
'string_label20' => '<string>',
'string_label21' => '<string>',
'string_label22' => '<string>',
'string_label23' => '<string>',
'string_label24' => '<string>',
'string_label25' => '<string>',
'string_label26' => '<string>',
'string_label27' => '<string>',
'string_label28' => '<string>',
'string_label29' => '<string>',
'string_label30' => '<string>',
'decimal_label1' => 123,
'decimal_label2' => 123,
'decimal_label3' => 123,
'decimal_label4' => 123,
'decimal_label5' => 123,
'decimal_label6' => 123,
'decimal_label7' => 123,
'decimal_label8' => 123,
'decimal_label9' => 123,
'decimal_label10' => 123,
'date_label1' => '2023-11-07T05:31:56Z',
'date_label2' => '2023-11-07T05:31:56Z',
'contract' => [
'$type' => 'Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core',
'identifier' => '<string>',
'currency' => '<string>',
'expiration_date' => '2023-11-07T05:31:56Z',
'asset_swap_spread' => 123,
'bond_identifier' => [
'$type' => 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
'code' => '<string>',
'market_identification_code' => '<string>'
],
'calendar_name' => '<string>',
'coupon_rate' => 123,
'end_to_end' => true,
'notional' => 123,
'payment_lag' => 123,
'period_str' => '<string>',
'rate_asset_name' => '<string>',
'roll_date' => '2023-11-07T05:31:56Z',
'start_date' => '2023-11-07T05:31:56Z',
'initial_fx_rate' => 123
]
]
],
'create_missing_books' => true,
'use_best_effort' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+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.riskportal.activeviam.com/api/LegacyPosition/PositionUpload"
payload := strings.NewReader("{\n \"$type\": \"Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core\",\n \"market_data_environment_name\": \"Example market data\",\n \"provider_id\": \"<string>\",\n \"positions\": [\n {\n \"$type\": \"Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core\",\n \"book\": \"<string>\",\n \"contract_size\": 123,\n \"quantity\": 123,\n \"quantity_traded\": 123,\n \"quantity_currency\": \"<string>\",\n \"buy_sell\": \"<string>\",\n \"tradable_id\": \"<string>\",\n \"trade_action\": \"<string>\",\n \"client_transaction_id\": \"<string>\",\n \"counterparty\": \"<string>\",\n \"structure\": \"<string>\",\n \"leg\": \"<string>\",\n \"stamp_derivitec_id\": true,\n \"traded_price_today\": 123,\n \"traded_price_previous\": 123,\n \"dealing_bank\": \"<string>\",\n \"notes\": \"<string>\",\n \"trade_date\": \"2023-11-07T05:31:56Z\",\n \"traded_notional\": 123,\n \"team\": \"<string>\",\n \"split_by_reporting_currency\": true,\n \"dealer_name\": \"<string>\",\n \"counterparty_alias\": \"<string>\",\n \"client\": \"<string>\",\n \"reference\": \"<string>\",\n \"product_type\": \"<string>\",\n \"business_unit\": \"<string>\",\n \"sub_business_unit\": \"<string>\",\n \"counterparty_account\": \"<string>\",\n \"strategy\": \"<string>\",\n \"entity\": \"<string>\",\n \"client_tradable_id\": \"<string>\",\n \"string_label1\": \"<string>\",\n \"string_label2\": \"<string>\",\n \"string_label3\": \"<string>\",\n \"string_label4\": \"<string>\",\n \"string_label5\": \"<string>\",\n \"string_label6\": \"<string>\",\n \"string_label7\": \"<string>\",\n \"string_label8\": \"<string>\",\n \"string_label9\": \"<string>\",\n \"string_label10\": \"<string>\",\n \"string_label11\": \"<string>\",\n \"string_label12\": \"<string>\",\n \"string_label13\": \"<string>\",\n \"string_label14\": \"<string>\",\n \"string_label15\": \"<string>\",\n \"string_label16\": \"<string>\",\n \"string_label17\": \"<string>\",\n \"string_label18\": \"<string>\",\n \"string_label19\": \"<string>\",\n \"string_label20\": \"<string>\",\n \"string_label21\": \"<string>\",\n \"string_label22\": \"<string>\",\n \"string_label23\": \"<string>\",\n \"string_label24\": \"<string>\",\n \"string_label25\": \"<string>\",\n \"string_label26\": \"<string>\",\n \"string_label27\": \"<string>\",\n \"string_label28\": \"<string>\",\n \"string_label29\": \"<string>\",\n \"string_label30\": \"<string>\",\n \"decimal_label1\": 123,\n \"decimal_label2\": 123,\n \"decimal_label3\": 123,\n \"decimal_label4\": 123,\n \"decimal_label5\": 123,\n \"decimal_label6\": 123,\n \"decimal_label7\": 123,\n \"decimal_label8\": 123,\n \"decimal_label9\": 123,\n \"decimal_label10\": 123,\n \"date_label1\": \"2023-11-07T05:31:56Z\",\n \"date_label2\": \"2023-11-07T05:31:56Z\",\n \"contract\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n }\n ],\n \"create_missing_books\": true,\n \"use_best_effort\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+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.riskportal.activeviam.com/api/LegacyPosition/PositionUpload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"$type\": \"Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core\",\n \"market_data_environment_name\": \"Example market data\",\n \"provider_id\": \"<string>\",\n \"positions\": [\n {\n \"$type\": \"Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core\",\n \"book\": \"<string>\",\n \"contract_size\": 123,\n \"quantity\": 123,\n \"quantity_traded\": 123,\n \"quantity_currency\": \"<string>\",\n \"buy_sell\": \"<string>\",\n \"tradable_id\": \"<string>\",\n \"trade_action\": \"<string>\",\n \"client_transaction_id\": \"<string>\",\n \"counterparty\": \"<string>\",\n \"structure\": \"<string>\",\n \"leg\": \"<string>\",\n \"stamp_derivitec_id\": true,\n \"traded_price_today\": 123,\n \"traded_price_previous\": 123,\n \"dealing_bank\": \"<string>\",\n \"notes\": \"<string>\",\n \"trade_date\": \"2023-11-07T05:31:56Z\",\n \"traded_notional\": 123,\n \"team\": \"<string>\",\n \"split_by_reporting_currency\": true,\n \"dealer_name\": \"<string>\",\n \"counterparty_alias\": \"<string>\",\n \"client\": \"<string>\",\n \"reference\": \"<string>\",\n \"product_type\": \"<string>\",\n \"business_unit\": \"<string>\",\n \"sub_business_unit\": \"<string>\",\n \"counterparty_account\": \"<string>\",\n \"strategy\": \"<string>\",\n \"entity\": \"<string>\",\n \"client_tradable_id\": \"<string>\",\n \"string_label1\": \"<string>\",\n \"string_label2\": \"<string>\",\n \"string_label3\": \"<string>\",\n \"string_label4\": \"<string>\",\n \"string_label5\": \"<string>\",\n \"string_label6\": \"<string>\",\n \"string_label7\": \"<string>\",\n \"string_label8\": \"<string>\",\n \"string_label9\": \"<string>\",\n \"string_label10\": \"<string>\",\n \"string_label11\": \"<string>\",\n \"string_label12\": \"<string>\",\n \"string_label13\": \"<string>\",\n \"string_label14\": \"<string>\",\n \"string_label15\": \"<string>\",\n \"string_label16\": \"<string>\",\n \"string_label17\": \"<string>\",\n \"string_label18\": \"<string>\",\n \"string_label19\": \"<string>\",\n \"string_label20\": \"<string>\",\n \"string_label21\": \"<string>\",\n \"string_label22\": \"<string>\",\n \"string_label23\": \"<string>\",\n \"string_label24\": \"<string>\",\n \"string_label25\": \"<string>\",\n \"string_label26\": \"<string>\",\n \"string_label27\": \"<string>\",\n \"string_label28\": \"<string>\",\n \"string_label29\": \"<string>\",\n \"string_label30\": \"<string>\",\n \"decimal_label1\": 123,\n \"decimal_label2\": 123,\n \"decimal_label3\": 123,\n \"decimal_label4\": 123,\n \"decimal_label5\": 123,\n \"decimal_label6\": 123,\n \"decimal_label7\": 123,\n \"decimal_label8\": 123,\n \"decimal_label9\": 123,\n \"decimal_label10\": 123,\n \"date_label1\": \"2023-11-07T05:31:56Z\",\n \"date_label2\": \"2023-11-07T05:31:56Z\",\n \"contract\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n }\n ],\n \"create_missing_books\": true,\n \"use_best_effort\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.riskportal.activeviam.com/api/LegacyPosition/PositionUpload")
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-patch+json'
request.body = "{\n \"$type\": \"Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core\",\n \"market_data_environment_name\": \"Example market data\",\n \"provider_id\": \"<string>\",\n \"positions\": [\n {\n \"$type\": \"Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core\",\n \"book\": \"<string>\",\n \"contract_size\": 123,\n \"quantity\": 123,\n \"quantity_traded\": 123,\n \"quantity_currency\": \"<string>\",\n \"buy_sell\": \"<string>\",\n \"tradable_id\": \"<string>\",\n \"trade_action\": \"<string>\",\n \"client_transaction_id\": \"<string>\",\n \"counterparty\": \"<string>\",\n \"structure\": \"<string>\",\n \"leg\": \"<string>\",\n \"stamp_derivitec_id\": true,\n \"traded_price_today\": 123,\n \"traded_price_previous\": 123,\n \"dealing_bank\": \"<string>\",\n \"notes\": \"<string>\",\n \"trade_date\": \"2023-11-07T05:31:56Z\",\n \"traded_notional\": 123,\n \"team\": \"<string>\",\n \"split_by_reporting_currency\": true,\n \"dealer_name\": \"<string>\",\n \"counterparty_alias\": \"<string>\",\n \"client\": \"<string>\",\n \"reference\": \"<string>\",\n \"product_type\": \"<string>\",\n \"business_unit\": \"<string>\",\n \"sub_business_unit\": \"<string>\",\n \"counterparty_account\": \"<string>\",\n \"strategy\": \"<string>\",\n \"entity\": \"<string>\",\n \"client_tradable_id\": \"<string>\",\n \"string_label1\": \"<string>\",\n \"string_label2\": \"<string>\",\n \"string_label3\": \"<string>\",\n \"string_label4\": \"<string>\",\n \"string_label5\": \"<string>\",\n \"string_label6\": \"<string>\",\n \"string_label7\": \"<string>\",\n \"string_label8\": \"<string>\",\n \"string_label9\": \"<string>\",\n \"string_label10\": \"<string>\",\n \"string_label11\": \"<string>\",\n \"string_label12\": \"<string>\",\n \"string_label13\": \"<string>\",\n \"string_label14\": \"<string>\",\n \"string_label15\": \"<string>\",\n \"string_label16\": \"<string>\",\n \"string_label17\": \"<string>\",\n \"string_label18\": \"<string>\",\n \"string_label19\": \"<string>\",\n \"string_label20\": \"<string>\",\n \"string_label21\": \"<string>\",\n \"string_label22\": \"<string>\",\n \"string_label23\": \"<string>\",\n \"string_label24\": \"<string>\",\n \"string_label25\": \"<string>\",\n \"string_label26\": \"<string>\",\n \"string_label27\": \"<string>\",\n \"string_label28\": \"<string>\",\n \"string_label29\": \"<string>\",\n \"string_label30\": \"<string>\",\n \"decimal_label1\": 123,\n \"decimal_label2\": 123,\n \"decimal_label3\": 123,\n \"decimal_label4\": 123,\n \"decimal_label5\": 123,\n \"decimal_label6\": 123,\n \"decimal_label7\": 123,\n \"decimal_label8\": 123,\n \"decimal_label9\": 123,\n \"decimal_label10\": 123,\n \"date_label1\": \"2023-11-07T05:31:56Z\",\n \"date_label2\": \"2023-11-07T05:31:56Z\",\n \"contract\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n }\n ],\n \"create_missing_books\": true,\n \"use_best_effort\": true\n}"
response = http.request(request)
puts response.read_body{
"$type": "Derivitec.Web.Core.Positions.ApiPositionUploadResponse, Derivitec.Web.Core",
"is_success": true,
"error_messages": [
"<string>"
],
"results": [
{
"$type": "Derivitec.Web.Core.Positions.PositionUploadResult, Derivitec.Web.Core",
"succeeded": true,
"client_transaction_id": "<string>",
"tradable_id": "<string>",
"error_message": "<string>"
}
]
}Upload typed positions.
Imports a non-empty typed-position list. Positions normally need book, trade action, client transaction identifier, quantity, trade
date, and contract or tradable details defined by the Position schema. Missing books can optionally
be created. Best-effort handling is available only to snapshot-enabled users, and the response is returned
after validation and any accepted import. Exceptions caught during import processing are returned in
ErrorMessages; Results is null when no parsing result is available.
curl --request POST \
--url https://api.riskportal.activeviam.com/api/LegacyPosition/PositionUpload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"$type": "Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core",
"market_data_environment_name": "Example market data",
"provider_id": "<string>",
"positions": [
{
"$type": "Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core",
"book": "<string>",
"contract_size": 123,
"quantity": 123,
"quantity_traded": 123,
"quantity_currency": "<string>",
"buy_sell": "<string>",
"tradable_id": "<string>",
"trade_action": "<string>",
"client_transaction_id": "<string>",
"counterparty": "<string>",
"structure": "<string>",
"leg": "<string>",
"stamp_derivitec_id": true,
"traded_price_today": 123,
"traded_price_previous": 123,
"dealing_bank": "<string>",
"notes": "<string>",
"trade_date": "2023-11-07T05:31:56Z",
"traded_notional": 123,
"team": "<string>",
"split_by_reporting_currency": true,
"dealer_name": "<string>",
"counterparty_alias": "<string>",
"client": "<string>",
"reference": "<string>",
"product_type": "<string>",
"business_unit": "<string>",
"sub_business_unit": "<string>",
"counterparty_account": "<string>",
"strategy": "<string>",
"entity": "<string>",
"client_tradable_id": "<string>",
"string_label1": "<string>",
"string_label2": "<string>",
"string_label3": "<string>",
"string_label4": "<string>",
"string_label5": "<string>",
"string_label6": "<string>",
"string_label7": "<string>",
"string_label8": "<string>",
"string_label9": "<string>",
"string_label10": "<string>",
"string_label11": "<string>",
"string_label12": "<string>",
"string_label13": "<string>",
"string_label14": "<string>",
"string_label15": "<string>",
"string_label16": "<string>",
"string_label17": "<string>",
"string_label18": "<string>",
"string_label19": "<string>",
"string_label20": "<string>",
"string_label21": "<string>",
"string_label22": "<string>",
"string_label23": "<string>",
"string_label24": "<string>",
"string_label25": "<string>",
"string_label26": "<string>",
"string_label27": "<string>",
"string_label28": "<string>",
"string_label29": "<string>",
"string_label30": "<string>",
"decimal_label1": 123,
"decimal_label2": 123,
"decimal_label3": 123,
"decimal_label4": 123,
"decimal_label5": 123,
"decimal_label6": 123,
"decimal_label7": 123,
"decimal_label8": 123,
"decimal_label9": 123,
"decimal_label10": 123,
"date_label1": "2023-11-07T05:31:56Z",
"date_label2": "2023-11-07T05:31:56Z",
"contract": {
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"calendar_name": "<string>",
"coupon_rate": 123,
"end_to_end": true,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"initial_fx_rate": 123
}
}
],
"create_missing_books": true,
"use_best_effort": true
}
'import requests
url = "https://api.riskportal.activeviam.com/api/LegacyPosition/PositionUpload"
payload = {
"$type": "Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core",
"market_data_environment_name": "Example market data",
"provider_id": "<string>",
"positions": [
{
"$type": "Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core",
"book": "<string>",
"contract_size": 123,
"quantity": 123,
"quantity_traded": 123,
"quantity_currency": "<string>",
"buy_sell": "<string>",
"tradable_id": "<string>",
"trade_action": "<string>",
"client_transaction_id": "<string>",
"counterparty": "<string>",
"structure": "<string>",
"leg": "<string>",
"stamp_derivitec_id": True,
"traded_price_today": 123,
"traded_price_previous": 123,
"dealing_bank": "<string>",
"notes": "<string>",
"trade_date": "2023-11-07T05:31:56Z",
"traded_notional": 123,
"team": "<string>",
"split_by_reporting_currency": True,
"dealer_name": "<string>",
"counterparty_alias": "<string>",
"client": "<string>",
"reference": "<string>",
"product_type": "<string>",
"business_unit": "<string>",
"sub_business_unit": "<string>",
"counterparty_account": "<string>",
"strategy": "<string>",
"entity": "<string>",
"client_tradable_id": "<string>",
"string_label1": "<string>",
"string_label2": "<string>",
"string_label3": "<string>",
"string_label4": "<string>",
"string_label5": "<string>",
"string_label6": "<string>",
"string_label7": "<string>",
"string_label8": "<string>",
"string_label9": "<string>",
"string_label10": "<string>",
"string_label11": "<string>",
"string_label12": "<string>",
"string_label13": "<string>",
"string_label14": "<string>",
"string_label15": "<string>",
"string_label16": "<string>",
"string_label17": "<string>",
"string_label18": "<string>",
"string_label19": "<string>",
"string_label20": "<string>",
"string_label21": "<string>",
"string_label22": "<string>",
"string_label23": "<string>",
"string_label24": "<string>",
"string_label25": "<string>",
"string_label26": "<string>",
"string_label27": "<string>",
"string_label28": "<string>",
"string_label29": "<string>",
"string_label30": "<string>",
"decimal_label1": 123,
"decimal_label2": 123,
"decimal_label3": 123,
"decimal_label4": 123,
"decimal_label5": 123,
"decimal_label6": 123,
"decimal_label7": 123,
"decimal_label8": 123,
"decimal_label9": 123,
"decimal_label10": 123,
"date_label1": "2023-11-07T05:31:56Z",
"date_label2": "2023-11-07T05:31:56Z",
"contract": {
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"calendar_name": "<string>",
"coupon_rate": 123,
"end_to_end": True,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"initial_fx_rate": 123
}
}
],
"create_missing_books": True,
"use_best_effort": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
$type: 'Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core',
market_data_environment_name: 'Example market data',
provider_id: '<string>',
positions: [
{
$type: 'Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core',
book: '<string>',
contract_size: 123,
quantity: 123,
quantity_traded: 123,
quantity_currency: '<string>',
buy_sell: '<string>',
tradable_id: '<string>',
trade_action: '<string>',
client_transaction_id: '<string>',
counterparty: '<string>',
structure: '<string>',
leg: '<string>',
stamp_derivitec_id: true,
traded_price_today: 123,
traded_price_previous: 123,
dealing_bank: '<string>',
notes: '<string>',
trade_date: '2023-11-07T05:31:56Z',
traded_notional: 123,
team: '<string>',
split_by_reporting_currency: true,
dealer_name: '<string>',
counterparty_alias: '<string>',
client: '<string>',
reference: '<string>',
product_type: '<string>',
business_unit: '<string>',
sub_business_unit: '<string>',
counterparty_account: '<string>',
strategy: '<string>',
entity: '<string>',
client_tradable_id: '<string>',
string_label1: '<string>',
string_label2: '<string>',
string_label3: '<string>',
string_label4: '<string>',
string_label5: '<string>',
string_label6: '<string>',
string_label7: '<string>',
string_label8: '<string>',
string_label9: '<string>',
string_label10: '<string>',
string_label11: '<string>',
string_label12: '<string>',
string_label13: '<string>',
string_label14: '<string>',
string_label15: '<string>',
string_label16: '<string>',
string_label17: '<string>',
string_label18: '<string>',
string_label19: '<string>',
string_label20: '<string>',
string_label21: '<string>',
string_label22: '<string>',
string_label23: '<string>',
string_label24: '<string>',
string_label25: '<string>',
string_label26: '<string>',
string_label27: '<string>',
string_label28: '<string>',
string_label29: '<string>',
string_label30: '<string>',
decimal_label1: 123,
decimal_label2: 123,
decimal_label3: 123,
decimal_label4: 123,
decimal_label5: 123,
decimal_label6: 123,
decimal_label7: 123,
decimal_label8: 123,
decimal_label9: 123,
decimal_label10: 123,
date_label1: '2023-11-07T05:31:56Z',
date_label2: '2023-11-07T05:31:56Z',
contract: {
$type: 'Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core',
identifier: '<string>',
currency: '<string>',
expiration_date: '2023-11-07T05:31:56Z',
asset_swap_spread: 123,
bond_identifier: {
$type: 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
code: '<string>',
market_identification_code: '<string>'
},
calendar_name: '<string>',
coupon_rate: 123,
end_to_end: true,
notional: 123,
payment_lag: 123,
period_str: '<string>',
rate_asset_name: '<string>',
roll_date: '2023-11-07T05:31:56Z',
start_date: '2023-11-07T05:31:56Z',
initial_fx_rate: 123
}
}
],
create_missing_books: true,
use_best_effort: true
})
};
fetch('https://api.riskportal.activeviam.com/api/LegacyPosition/PositionUpload', 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.riskportal.activeviam.com/api/LegacyPosition/PositionUpload",
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([
'$type' => 'Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core',
'market_data_environment_name' => 'Example market data',
'provider_id' => '<string>',
'positions' => [
[
'$type' => 'Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core',
'book' => '<string>',
'contract_size' => 123,
'quantity' => 123,
'quantity_traded' => 123,
'quantity_currency' => '<string>',
'buy_sell' => '<string>',
'tradable_id' => '<string>',
'trade_action' => '<string>',
'client_transaction_id' => '<string>',
'counterparty' => '<string>',
'structure' => '<string>',
'leg' => '<string>',
'stamp_derivitec_id' => true,
'traded_price_today' => 123,
'traded_price_previous' => 123,
'dealing_bank' => '<string>',
'notes' => '<string>',
'trade_date' => '2023-11-07T05:31:56Z',
'traded_notional' => 123,
'team' => '<string>',
'split_by_reporting_currency' => true,
'dealer_name' => '<string>',
'counterparty_alias' => '<string>',
'client' => '<string>',
'reference' => '<string>',
'product_type' => '<string>',
'business_unit' => '<string>',
'sub_business_unit' => '<string>',
'counterparty_account' => '<string>',
'strategy' => '<string>',
'entity' => '<string>',
'client_tradable_id' => '<string>',
'string_label1' => '<string>',
'string_label2' => '<string>',
'string_label3' => '<string>',
'string_label4' => '<string>',
'string_label5' => '<string>',
'string_label6' => '<string>',
'string_label7' => '<string>',
'string_label8' => '<string>',
'string_label9' => '<string>',
'string_label10' => '<string>',
'string_label11' => '<string>',
'string_label12' => '<string>',
'string_label13' => '<string>',
'string_label14' => '<string>',
'string_label15' => '<string>',
'string_label16' => '<string>',
'string_label17' => '<string>',
'string_label18' => '<string>',
'string_label19' => '<string>',
'string_label20' => '<string>',
'string_label21' => '<string>',
'string_label22' => '<string>',
'string_label23' => '<string>',
'string_label24' => '<string>',
'string_label25' => '<string>',
'string_label26' => '<string>',
'string_label27' => '<string>',
'string_label28' => '<string>',
'string_label29' => '<string>',
'string_label30' => '<string>',
'decimal_label1' => 123,
'decimal_label2' => 123,
'decimal_label3' => 123,
'decimal_label4' => 123,
'decimal_label5' => 123,
'decimal_label6' => 123,
'decimal_label7' => 123,
'decimal_label8' => 123,
'decimal_label9' => 123,
'decimal_label10' => 123,
'date_label1' => '2023-11-07T05:31:56Z',
'date_label2' => '2023-11-07T05:31:56Z',
'contract' => [
'$type' => 'Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core',
'identifier' => '<string>',
'currency' => '<string>',
'expiration_date' => '2023-11-07T05:31:56Z',
'asset_swap_spread' => 123,
'bond_identifier' => [
'$type' => 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
'code' => '<string>',
'market_identification_code' => '<string>'
],
'calendar_name' => '<string>',
'coupon_rate' => 123,
'end_to_end' => true,
'notional' => 123,
'payment_lag' => 123,
'period_str' => '<string>',
'rate_asset_name' => '<string>',
'roll_date' => '2023-11-07T05:31:56Z',
'start_date' => '2023-11-07T05:31:56Z',
'initial_fx_rate' => 123
]
]
],
'create_missing_books' => true,
'use_best_effort' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+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.riskportal.activeviam.com/api/LegacyPosition/PositionUpload"
payload := strings.NewReader("{\n \"$type\": \"Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core\",\n \"market_data_environment_name\": \"Example market data\",\n \"provider_id\": \"<string>\",\n \"positions\": [\n {\n \"$type\": \"Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core\",\n \"book\": \"<string>\",\n \"contract_size\": 123,\n \"quantity\": 123,\n \"quantity_traded\": 123,\n \"quantity_currency\": \"<string>\",\n \"buy_sell\": \"<string>\",\n \"tradable_id\": \"<string>\",\n \"trade_action\": \"<string>\",\n \"client_transaction_id\": \"<string>\",\n \"counterparty\": \"<string>\",\n \"structure\": \"<string>\",\n \"leg\": \"<string>\",\n \"stamp_derivitec_id\": true,\n \"traded_price_today\": 123,\n \"traded_price_previous\": 123,\n \"dealing_bank\": \"<string>\",\n \"notes\": \"<string>\",\n \"trade_date\": \"2023-11-07T05:31:56Z\",\n \"traded_notional\": 123,\n \"team\": \"<string>\",\n \"split_by_reporting_currency\": true,\n \"dealer_name\": \"<string>\",\n \"counterparty_alias\": \"<string>\",\n \"client\": \"<string>\",\n \"reference\": \"<string>\",\n \"product_type\": \"<string>\",\n \"business_unit\": \"<string>\",\n \"sub_business_unit\": \"<string>\",\n \"counterparty_account\": \"<string>\",\n \"strategy\": \"<string>\",\n \"entity\": \"<string>\",\n \"client_tradable_id\": \"<string>\",\n \"string_label1\": \"<string>\",\n \"string_label2\": \"<string>\",\n \"string_label3\": \"<string>\",\n \"string_label4\": \"<string>\",\n \"string_label5\": \"<string>\",\n \"string_label6\": \"<string>\",\n \"string_label7\": \"<string>\",\n \"string_label8\": \"<string>\",\n \"string_label9\": \"<string>\",\n \"string_label10\": \"<string>\",\n \"string_label11\": \"<string>\",\n \"string_label12\": \"<string>\",\n \"string_label13\": \"<string>\",\n \"string_label14\": \"<string>\",\n \"string_label15\": \"<string>\",\n \"string_label16\": \"<string>\",\n \"string_label17\": \"<string>\",\n \"string_label18\": \"<string>\",\n \"string_label19\": \"<string>\",\n \"string_label20\": \"<string>\",\n \"string_label21\": \"<string>\",\n \"string_label22\": \"<string>\",\n \"string_label23\": \"<string>\",\n \"string_label24\": \"<string>\",\n \"string_label25\": \"<string>\",\n \"string_label26\": \"<string>\",\n \"string_label27\": \"<string>\",\n \"string_label28\": \"<string>\",\n \"string_label29\": \"<string>\",\n \"string_label30\": \"<string>\",\n \"decimal_label1\": 123,\n \"decimal_label2\": 123,\n \"decimal_label3\": 123,\n \"decimal_label4\": 123,\n \"decimal_label5\": 123,\n \"decimal_label6\": 123,\n \"decimal_label7\": 123,\n \"decimal_label8\": 123,\n \"decimal_label9\": 123,\n \"decimal_label10\": 123,\n \"date_label1\": \"2023-11-07T05:31:56Z\",\n \"date_label2\": \"2023-11-07T05:31:56Z\",\n \"contract\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n }\n ],\n \"create_missing_books\": true,\n \"use_best_effort\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+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.riskportal.activeviam.com/api/LegacyPosition/PositionUpload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"$type\": \"Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core\",\n \"market_data_environment_name\": \"Example market data\",\n \"provider_id\": \"<string>\",\n \"positions\": [\n {\n \"$type\": \"Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core\",\n \"book\": \"<string>\",\n \"contract_size\": 123,\n \"quantity\": 123,\n \"quantity_traded\": 123,\n \"quantity_currency\": \"<string>\",\n \"buy_sell\": \"<string>\",\n \"tradable_id\": \"<string>\",\n \"trade_action\": \"<string>\",\n \"client_transaction_id\": \"<string>\",\n \"counterparty\": \"<string>\",\n \"structure\": \"<string>\",\n \"leg\": \"<string>\",\n \"stamp_derivitec_id\": true,\n \"traded_price_today\": 123,\n \"traded_price_previous\": 123,\n \"dealing_bank\": \"<string>\",\n \"notes\": \"<string>\",\n \"trade_date\": \"2023-11-07T05:31:56Z\",\n \"traded_notional\": 123,\n \"team\": \"<string>\",\n \"split_by_reporting_currency\": true,\n \"dealer_name\": \"<string>\",\n \"counterparty_alias\": \"<string>\",\n \"client\": \"<string>\",\n \"reference\": \"<string>\",\n \"product_type\": \"<string>\",\n \"business_unit\": \"<string>\",\n \"sub_business_unit\": \"<string>\",\n \"counterparty_account\": \"<string>\",\n \"strategy\": \"<string>\",\n \"entity\": \"<string>\",\n \"client_tradable_id\": \"<string>\",\n \"string_label1\": \"<string>\",\n \"string_label2\": \"<string>\",\n \"string_label3\": \"<string>\",\n \"string_label4\": \"<string>\",\n \"string_label5\": \"<string>\",\n \"string_label6\": \"<string>\",\n \"string_label7\": \"<string>\",\n \"string_label8\": \"<string>\",\n \"string_label9\": \"<string>\",\n \"string_label10\": \"<string>\",\n \"string_label11\": \"<string>\",\n \"string_label12\": \"<string>\",\n \"string_label13\": \"<string>\",\n \"string_label14\": \"<string>\",\n \"string_label15\": \"<string>\",\n \"string_label16\": \"<string>\",\n \"string_label17\": \"<string>\",\n \"string_label18\": \"<string>\",\n \"string_label19\": \"<string>\",\n \"string_label20\": \"<string>\",\n \"string_label21\": \"<string>\",\n \"string_label22\": \"<string>\",\n \"string_label23\": \"<string>\",\n \"string_label24\": \"<string>\",\n \"string_label25\": \"<string>\",\n \"string_label26\": \"<string>\",\n \"string_label27\": \"<string>\",\n \"string_label28\": \"<string>\",\n \"string_label29\": \"<string>\",\n \"string_label30\": \"<string>\",\n \"decimal_label1\": 123,\n \"decimal_label2\": 123,\n \"decimal_label3\": 123,\n \"decimal_label4\": 123,\n \"decimal_label5\": 123,\n \"decimal_label6\": 123,\n \"decimal_label7\": 123,\n \"decimal_label8\": 123,\n \"decimal_label9\": 123,\n \"decimal_label10\": 123,\n \"date_label1\": \"2023-11-07T05:31:56Z\",\n \"date_label2\": \"2023-11-07T05:31:56Z\",\n \"contract\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n }\n ],\n \"create_missing_books\": true,\n \"use_best_effort\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.riskportal.activeviam.com/api/LegacyPosition/PositionUpload")
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-patch+json'
request.body = "{\n \"$type\": \"Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core\",\n \"market_data_environment_name\": \"Example market data\",\n \"provider_id\": \"<string>\",\n \"positions\": [\n {\n \"$type\": \"Derivitec.Web.Core.Positions.Position, Derivitec.Web.Core\",\n \"book\": \"<string>\",\n \"contract_size\": 123,\n \"quantity\": 123,\n \"quantity_traded\": 123,\n \"quantity_currency\": \"<string>\",\n \"buy_sell\": \"<string>\",\n \"tradable_id\": \"<string>\",\n \"trade_action\": \"<string>\",\n \"client_transaction_id\": \"<string>\",\n \"counterparty\": \"<string>\",\n \"structure\": \"<string>\",\n \"leg\": \"<string>\",\n \"stamp_derivitec_id\": true,\n \"traded_price_today\": 123,\n \"traded_price_previous\": 123,\n \"dealing_bank\": \"<string>\",\n \"notes\": \"<string>\",\n \"trade_date\": \"2023-11-07T05:31:56Z\",\n \"traded_notional\": 123,\n \"team\": \"<string>\",\n \"split_by_reporting_currency\": true,\n \"dealer_name\": \"<string>\",\n \"counterparty_alias\": \"<string>\",\n \"client\": \"<string>\",\n \"reference\": \"<string>\",\n \"product_type\": \"<string>\",\n \"business_unit\": \"<string>\",\n \"sub_business_unit\": \"<string>\",\n \"counterparty_account\": \"<string>\",\n \"strategy\": \"<string>\",\n \"entity\": \"<string>\",\n \"client_tradable_id\": \"<string>\",\n \"string_label1\": \"<string>\",\n \"string_label2\": \"<string>\",\n \"string_label3\": \"<string>\",\n \"string_label4\": \"<string>\",\n \"string_label5\": \"<string>\",\n \"string_label6\": \"<string>\",\n \"string_label7\": \"<string>\",\n \"string_label8\": \"<string>\",\n \"string_label9\": \"<string>\",\n \"string_label10\": \"<string>\",\n \"string_label11\": \"<string>\",\n \"string_label12\": \"<string>\",\n \"string_label13\": \"<string>\",\n \"string_label14\": \"<string>\",\n \"string_label15\": \"<string>\",\n \"string_label16\": \"<string>\",\n \"string_label17\": \"<string>\",\n \"string_label18\": \"<string>\",\n \"string_label19\": \"<string>\",\n \"string_label20\": \"<string>\",\n \"string_label21\": \"<string>\",\n \"string_label22\": \"<string>\",\n \"string_label23\": \"<string>\",\n \"string_label24\": \"<string>\",\n \"string_label25\": \"<string>\",\n \"string_label26\": \"<string>\",\n \"string_label27\": \"<string>\",\n \"string_label28\": \"<string>\",\n \"string_label29\": \"<string>\",\n \"string_label30\": \"<string>\",\n \"decimal_label1\": 123,\n \"decimal_label2\": 123,\n \"decimal_label3\": 123,\n \"decimal_label4\": 123,\n \"decimal_label5\": 123,\n \"decimal_label6\": 123,\n \"decimal_label7\": 123,\n \"decimal_label8\": 123,\n \"decimal_label9\": 123,\n \"decimal_label10\": 123,\n \"date_label1\": \"2023-11-07T05:31:56Z\",\n \"date_label2\": \"2023-11-07T05:31:56Z\",\n \"contract\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n }\n ],\n \"create_missing_books\": true,\n \"use_best_effort\": true\n}"
response = http.request(request)
puts response.read_body{
"$type": "Derivitec.Web.Core.Positions.ApiPositionUploadResponse, Derivitec.Web.Core",
"is_success": true,
"error_messages": [
"<string>"
],
"results": [
{
"$type": "Derivitec.Web.Core.Positions.PositionUploadResult, Derivitec.Web.Core",
"succeeded": true,
"client_transaction_id": "<string>",
"tradable_id": "<string>",
"error_message": "<string>"
}
]
}Authorizations
OAuth2 access-token requested from AWS Cognito and provided as a Auth Bearer header
Body
Required non-null, non-empty Positions; CreateMissingBooks and UseBestEffort default to false, and FileTemplate defaults to DerivitecMixed.
Typed positions submitted for synchronous validation and upload through an accessible market-data environment.
Derivitec.Web.Core.Positions.ApiPositionUploadRequest, Derivitec.Web.Core Name of the market-data environment to use. Supply either this name or provider_id, not both.
"Example market data"
Opaque identifier of the market-data provider to use. Supply either this identifier or market_data_environment_name, not both.
Typed position changes to validate against contract data and editable books.
Show child attributes
Show child attributes
Legacy typed upload may create missing books when true; the newer typed upload ignores this field. Defaults to false.
Compatibility template selection that current typed-upload workflows do not consult; defaults to derivitec_mixed.
derivitec_mixed, derivitec_by_security_type, eze Legacy typed upload permits partial import for snapshot-enabled users when true; the newer typed upload ignores this field. Defaults to false.
Response
Returns overall success and errors, with per-row results for parsed failures; invalid tables, missing books, exceptions, and parse failures are reported in the body.
Aggregate upload outcome and available per-position results for a typed position batch.
Derivitec.Web.Core.Positions.ApiPositionUploadResponse, Derivitec.Web.Core Whether the operation completed successfully. The default is true; error outcomes set it to false.
true
Messages explaining operation-level failures. The collection is empty by default.
Per-position successes or failures emitted by the selected upload workflow.
May be null when the workflow does not produce per-position details, including when processing
fails before parsing completes; use IsSuccess and ErrorMessages for the overall outcome.
Show child attributes
Show child attributes
Was this page helpful?