CreateSessionCapabilitiesSubscription

class saxo_openapi.endpoints.rootservices.sessions.CreateSessionCapabilitiesSubscription(data)

Set up a new session capabilities subscription. The data stream will deliver updates from this point.

ENDPOINT = 'openapi/root/v1/sessions/events/subscriptions/'
EXPECTED_STATUS = 201
METHOD = 'POST'
__init__(data)

Instantiate a ChangeSessionCapabilitiesSubscription request.

>>> import saxo_openapi
>>> import saxo_openapi.endpoints.rootservices as rs
>>> import json
>>> client = saxo_openapi.API(access_token=...)
>>> data =
        {
          "ContextId": "20190314053019906",
          "ReferenceId": "S56886",
          "RefreshRate": 1000,
          "Tag": "PAGE1"
        }
>>> r = rs.sessions.ChangeSessionCapabilitiesSubscription(data=data)
>>> rv = client.request(r)
>>> print(rv)

Output:

{
  "ContextId": "20190314053019906",
  "Format": "application/json",
  "InactivityTimeout": 120,
  "ReferenceId": "S56886",
  "RefreshRate": 1000,
  "Snapshot": {
    "DataLevel": "Standard",
    "TradeLevel": "OrdersOnly"
  },
  "State": "Active"
}
expected_status
response

response - get the response of the request.

status_code