REST/WS API Gateway Configuration
The REST/WebSocket API gateway runs inside the Ember Monitor backend.
To configure this gateway, follow these steps:
Add the following stanza to ember.conf:
monitor {
# REST/WS API Gateway section
gateway {
accounts = [
{
"sourceId" = "CLIENT1",
"apiKey" = "w6AcfksrG7GiEFoN",
"apiSecret" = "gZ0kkI9p8bHHDaBjO3Cyij87SrToYPA3"
}
# comma-separated list of other client accounts may follow here
# ...
]
}
}Restart the Ember Monitor service.
For more information about REST/WS API gateway configuration and Ember configuration in general, please visit the Configuration Reference document.
The gateway supports multiple API client accounts, each mapped to a specific order source. The concept of order source is fundamental in Ember and is described in the Data Model document. REST/WS API access can be granted to multiple clients (sources).
By default, Ember ensures that each client can only submit orders on behind of their own source ID. When a client is listing active orders or fetching the current position, the API gateway ensures that the client can only see orders and positions sourced by itself.
You can find examples of using the REST/WS API on GitHub. Follow the README instructions.