Value Channel
CHANNELvalue
The value
channel provides real-time value updates for indices.
Subscribe Request
- Subscribe Schema
- Example
MESSAGE BODY
type string required
Value:
subscribe
stream string required
Value:
value
id string required
stream ID
{
"type": "subscribe",
"id": "BRTI",
"stream": "value"
}
Responses
- Update Response Schema
- Update Example 1
- Update Example 2
- Failed Subscribe Schema
- Failed Subscribe Example
No ack response if successful. The most recent value will be sent, and subsequent values until the unsubscribe command is sent.
MESSAGE BODY
type string
Value:
value
id string
Stream ID
time string
Calculation time of value in milliseconds since Unix epoch
value string
Index value. May use scientific notation if an exponent is needed.
amendTime number conditional
Condition: If the value has been amended after being previously published
This field indicates the time of the amendment in milliseconds since Unix epoch
repeatOfPreviousValue boolean conditional
Condition: If an error has occurred during calculation such that an index value could not be calculated for that day, and it has been replaced with the value from the previous day.
Value:
true
{
"type": "value",
"id": "BRTI",
"value": "8835.56",
"time": 1579264280000
}
{
"type": "value",
"id": "BRR",
"value": "57260.71",
"time": 1620313200000,
"amendTime": 1620313300000,
"repeatOfPreviousValue": true
}
Returned if you specified an unknown stream ID.
MESSAGE BODY
type string
Value:
subscribe
id string
Stream ID
stream string
Value:
value
success boolean
Value:
false
reason string
Error description
{
"type": "subscribe",
"id": "BRR",
"stream": "value",
"success": false,
"reason": "Unrecognised id"
}
Unsubscribe Request
- Unsubscribe Schema
- Unsubscribe Example
No direct response if successful. Messages for the subscription will cease.
MESSAGE BODY
type string required
Value:
unsubscribe
stream string required
Value:
value
id string required
stream ID
{
"type": "unsubscribe",
"id": "BRTI",
"stream": "value"
}