Correct Trade Context
curl --request POST \
--url https://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"event_ref": {
"id": "<string>",
"revision": 2
},
"chart_session_ref": {
"id": "<string>",
"revision": 2
},
"expected_context_revision": 2,
"contract_version": "1"
}
'import requests
url = "https://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions"
payload = {
"event_ref": {
"id": "<string>",
"revision": 2
},
"chart_session_ref": {
"id": "<string>",
"revision": 2
},
"expected_context_revision": 2,
"contract_version": "1"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_ref: {id: '<string>', revision: 2},
chart_session_ref: {id: '<string>', revision: 2},
expected_context_revision: 2,
contract_version: '1'
})
};
fetch('https://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions', 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.example.com/api/graph/v1/trade-contexts/{context_id}/revisions",
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([
'event_ref' => [
'id' => '<string>',
'revision' => 2
],
'chart_session_ref' => [
'id' => '<string>',
'revision' => 2
],
'expected_context_revision' => 2,
'contract_version' => '1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions"
payload := strings.NewReader("{\n \"event_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"chart_session_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"expected_context_revision\": 2,\n \"contract_version\": \"1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-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://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"event_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"chart_session_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"expected_context_revision\": 2,\n \"contract_version\": \"1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"chart_session_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"expected_context_revision\": 2,\n \"contract_version\": \"1\"\n}"
response = http.request(request)
puts response.read_body{
"contract_version": "trade-context-v1",
"context_id": "<string>",
"revision": 2,
"execution_effect": "none",
"event_ref": {
"id": "<string>",
"revision": 2
},
"setup": {
"pattern_id": "<string>",
"pattern_version": 2,
"family": "<string>",
"direction": 123,
"grain": "<string>"
},
"chart": {
"session_ref": {
"id": "<string>",
"revision": 2,
"revision_hash": "<string>"
},
"symbol": "<string>",
"interval": "1m",
"visible_range": {
"from_time": 2,
"to_time": 2
},
"chart_type": "area",
"focused_event_ref": {
"id": "<string>",
"revision": 2
},
"timezone": "<string>",
"selected_range": {
"from_time": 2,
"to_time": 2
}
},
"captured_at": "2023-11-07T05:31:56Z",
"provenance": {
"event_registry": {},
"event_producer_time": "2023-11-07T05:31:56Z",
"lifecycle_id": "<string>",
"source_contract": "event-linked-decision-lens-v1"
},
"content_hash": "<string>",
"revision_hash": "<string>",
"replayed": true,
"lens_ref": {
"id": "<string>",
"revision": 2
},
"previous_hash": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Trade Context
Correct Trade Context
POST
/
api
/
graph
/
v1
/
trade-contexts
/
{context_id}
/
revisions
Correct Trade Context
curl --request POST \
--url https://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"event_ref": {
"id": "<string>",
"revision": 2
},
"chart_session_ref": {
"id": "<string>",
"revision": 2
},
"expected_context_revision": 2,
"contract_version": "1"
}
'import requests
url = "https://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions"
payload = {
"event_ref": {
"id": "<string>",
"revision": 2
},
"chart_session_ref": {
"id": "<string>",
"revision": 2
},
"expected_context_revision": 2,
"contract_version": "1"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_ref: {id: '<string>', revision: 2},
chart_session_ref: {id: '<string>', revision: 2},
expected_context_revision: 2,
contract_version: '1'
})
};
fetch('https://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions', 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.example.com/api/graph/v1/trade-contexts/{context_id}/revisions",
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([
'event_ref' => [
'id' => '<string>',
'revision' => 2
],
'chart_session_ref' => [
'id' => '<string>',
'revision' => 2
],
'expected_context_revision' => 2,
'contract_version' => '1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions"
payload := strings.NewReader("{\n \"event_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"chart_session_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"expected_context_revision\": 2,\n \"contract_version\": \"1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-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://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"event_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"chart_session_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"expected_context_revision\": 2,\n \"contract_version\": \"1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/trade-contexts/{context_id}/revisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"chart_session_ref\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"expected_context_revision\": 2,\n \"contract_version\": \"1\"\n}"
response = http.request(request)
puts response.read_body{
"contract_version": "trade-context-v1",
"context_id": "<string>",
"revision": 2,
"execution_effect": "none",
"event_ref": {
"id": "<string>",
"revision": 2
},
"setup": {
"pattern_id": "<string>",
"pattern_version": 2,
"family": "<string>",
"direction": 123,
"grain": "<string>"
},
"chart": {
"session_ref": {
"id": "<string>",
"revision": 2,
"revision_hash": "<string>"
},
"symbol": "<string>",
"interval": "1m",
"visible_range": {
"from_time": 2,
"to_time": 2
},
"chart_type": "area",
"focused_event_ref": {
"id": "<string>",
"revision": 2
},
"timezone": "<string>",
"selected_range": {
"from_time": 2,
"to_time": 2
}
},
"captured_at": "2023-11-07T05:31:56Z",
"provenance": {
"event_registry": {},
"event_producer_time": "2023-11-07T05:31:56Z",
"lifecycle_id": "<string>",
"source_contract": "event-linked-decision-lens-v1"
},
"content_hash": "<string>",
"revision_hash": "<string>",
"replayed": true,
"lens_ref": {
"id": "<string>",
"revision": 2
},
"previous_hash": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Required string length:
8 - 128Path Parameters
Body
application/json
Response
Successful Response
Allowed value:
"trade-context-v1"Required range:
x >= 1Allowed value:
"none"Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Pattern:
^[0-9a-f]{64}$Pattern:
^[0-9a-f]{64}$Show child attributes
Show child attributes
Pattern:
^[0-9a-f]{64}$