In contrast to events, making snapshots is done by performing HTTP requests to various endpoints. You can send these requests using any HTTP client of your choice.
All endpoints listed below are relative to
https://HOST:PORT/repo
. The value ofHOST:PORT
is provided by Spotware's service assurance team upon request.
Note that all requests listed below return arrays of bytes that you can serialise into the required entities. For example, in Java this can be done by calling the
parseFrom()
method from a suitable static class.
It is only possible to send a maximum of two concurrent requests per server when making shapshots. When requesting a snapshot, make sure to set a timeout of no less than 20 seconds.
It is possible to make snapshots for the following types of entities.
assets
assetClasses
symbols
symbolCategories
traders
traderGroups
balanceHistories
bonusHistories
deals
dealOffsets
orders
positions
authentications
actions
eodSpotSnapshotReports
eodOpenPositionReports
eodTraderReports
priceSnapshots
priceStreams
swapCalculations
commissionProfiles
dynamicLeverageProfiles
volumeProfiles
executionProfiles
protectionProfiles
swapFreeProfiles
scheduleProfiles
gslScheduleProfiles
swapAndDividendProfiles
holidayProfiles
holidays
countries
The structure of this request varies depending on the type of entity that you want to learn more about.
HTTP Method | URL |
---|---|
GET |
/{entity} |
Gets a sorted list of entities of the entity
type (any type except for eodSpotSnapshotReports
, eodOpenPositionReports
, and eodTraderReports
).
Parameters
Parameter | Parameter Type | Required? | Data Type | Description |
---|---|---|---|---|
entity |
path | Yes | string | The type of the entity that you would like to request information about. The full list of permissable entity types is given above. |
direction |
query | Yes | string | The direction in which the requested list of entities should be sorted. This parameter can only take two values.asc . The list is sorted in ascending order.desc . The list is sorted in descending order. |
size |
query | Yes | integer | The maximum possible number of entities that should be returned in the response. For the traderGroups entity, this parameter can take values ranging from 1 to 5 .For all other entities, this parameter can take values ranging from 100 to 15000 . |
id |
query | No | integer | The entity ID serving as a cut-off point for requesting information. If direction=asc , the cTrader backend will return all entities whose ID is greater than the specified id .If direction=desc , the cTrader backend will return all entities whose ID is less than the specified id . |
Request Body
No request body.
Output
An array of bytes representing the requested entity(ies).
Request Examples
Requesting the first 100 deals.
curl -X GET "https://HOST:PORT/repo/deals?size=100&direction=asc"
Requesting 100 deals whose IDs are less than 1001
.
curl -X GET "https://HOST:PORT/repo/deals?id=1001&size=100&direction=desc"
Requesting the latest 100 deals.
curl -X GET "https://HOST:PORT/repo/deals?size=100&direction=desc"
Response Example
As the response contains only an array of bytes, no specific example can be provided.
HTTP Method | URL |
---|---|
GET |
/{entity} |
Gets a sorted list of entities of the entity
type (only eodSpotSnapshotReports
, eodOpenPositionReports
, and eodTraderReports
are accepted as valid types).
Parameters
Parameter | Parameter Type | Required? | Data Type | Description |
---|---|---|---|---|
entity |
path | Yes | string | The type of the entity that you would like to request information about. The full list of permissable entity types is given above. |
date |
query | Yes | string | The report date in the YYYY-MM-DD format. |
direction |
query | Yes | string | The direction in which the requested list of entities should be sorted. This parameter can only take two values.asc . The list is sorted in ascending order.desc . The list is sorted in descending order. |
size |
query | Yes | integer | The maximum possible number of entities that should be returned in the response. For the traderGroups entity, this parameter can take values ranging from 1 to 5 .For all other entities, this parameter can take values ranging from 100 to 15000 . |
page |
query | Yes | integer | The report page number. This parameter can only take positive integer values. |
Request Body
No request body.
Output
An array of bytes representing the requested entity(-ies).
Request Examples
Requesting the first 100 reports for 23/12/2021.
curl -X GET "https://HOST:PORT/repo/eodSpotSnapshotReports/2021-12-23?size=100&page=0&direction=asc" -H "Accept: application/x-protobuf"
Response Example
As the response contains only an array of bytes, no specific example can be provided.
HTTP Method | URL |
---|---|
GET |
/{entity}/{id} |
Gets a single entity with the specified id
.
This API call is not available for the
actions
,eodSpotSnapshotReports
,eodOpenPositionReports
, andeodTraderReports
entities.
Parameters
Parameter | Parameter Type | Required? | Data Type | Description |
---|---|---|---|---|
entity |
path | Yes | string | The type of the entity that you would like to request information about. The full list of permissable entity types is given above. |
id |
path | Yes | integer | The ID of the entity that you would like to request information about. |
Request Body
No request body.
Output
An array of bytes representing the requested entity(ies).
Request Examples
Requesting the authentication
entity with id=70
.
curl -X GET "https://HOST:PORT/repo/authentications/70"
Response Example
As the response contains only an array of bytes, no specific example can be provided.