GetAllocationKeys

class saxo_openapi.endpoints.trading.allocationkeys.GetAllocationKeys(params)

Get a list of existing allocation keys. By default only Active allocation keys for the current client are returned.

ENDPOINT = 'openapi/trade/v1/allocationkeys'
EXPECTED_STATUS = 200
METHOD = 'GET'
__init__(params)

Instantiate a GetAllocationKeys request.

Parameters:params (dict (required)) – dict representing the querystring parameters
>>> import saxo_openapi
>>> import saxo_openapi.endpoints.trading as tr
>>> import json
>>> client = saxo_openapi.API(access_token=...)
>>> params =
        {
          "$top": 601,
          "$skip": 22968,
          "AccountKey": "...",
          "ClientKey": "...",
          "Statuses": "Active,OneTime"
        }
>>> r = tr.allocationkeys.GetAllocationKeys(params=params)
>>> client.request(r)
>>> print(json.dumps(r.response, indent=4))

Output:

{
  "Data": [
    {
      "AllocationKeyId": "227",
      "AllocationKeyName": "MyAllocation_Key",
      "OwnerAccountKey": "LZTc7DdejXODf-WSl2aCyQ==",
      "Status": "Active"
    },
    {
      "AllocationKeyId": "227_2",
      "AllocationKeyName": "MyAllocation_Key_2",
      "OwnerAccountKey": "LZTc7DdejXODf-WSl2aCyQ==",
      "Status": "OneTime"
    }
  ]
}
expected_status
response

response - get the response of the request.

status_code