Get user log stream#
About#
Returns event log stream for a CopyFactory subscriber. If there are no new recors yet, the response will not be sent until a timeout expires or new record arrives. It is recommended to invoke this API in an infinite cycle constantly polling for new records to receive records in real time
GET /users/current/subscribers/:subscriberId/user-log/stream
For more information see Swagger documentation
Headers#
Name | Type | Required | Description |
---|---|---|---|
auth-token | string | Yes | authorization token. See Authentication & authorization |
Path parameters#
Name | Type | Required | Description |
---|---|---|---|
subscriberId | string | Yes | subscriber id |
Query parameters#
Name | Type | Required | Description |
---|---|---|---|
startTime | string(datetime) | start of time range, inclusive (in ISO format) | |
limit | integer | pagination limit, default: 1000 , min: 1 , max: 1000 |
Response#
Responses:
- 200 - Log messages returned successfully. Response schema: Array<UserLogMessage>
- 401 - Authorization failed. Response schema: Error
- 404 - Subscriber not found. Response schema: Error
Examples#
Example request:
curl -X GET --header 'Accept: application/json' --header 'auth-token: token' 'https://copyfactory-api-v1.new-york.agiliumtrade.ai/users/current/subscribers/105646d8-8c97-4d4d-9b74-413bd66cd4ed/user-log/stream?startTime="2020-04-20T04:00:00.000Z"&limit=50'
Example response:
[
{
"time": "2020-08-24T00:00:00.000Z",
"symbol": "AUDUSD",
"strategyId": "nIMn",
"strategyName": "Demo strategy",
"positionId": "+apNW3",
"side": "buy",
"type": "market",
"openPrice": 1.02371,
"level": "INFO",
"message": "Received a buy signal from Demo strategy strategy"
}
]