Single-Factor Authentication
Perform regular authentication in Autoshares Trader
Last updated
Perform regular authentication in Autoshares Trader
Last updated
All API requests in Autoshares Trader require a unique authentication token that must be provided in the request header. Without this token, it's impossible to place orders, retrieve charts, create users, etc. To get the token, use the following API endpoint:
The header of the request must contain the following three parameters:
Et-App-Key. This is the API key of your company that can be found it in the BO Companies widget. When editing the company's settings, navigate to the WebApi tab and look for the required key (it could be a key for the web terminal, the mobile app, or a custom key).
Username. This is the username of the user on whose behalf all future requests will be made.
Password. This is the password of the user on whose behalf all future requests will be made.
The following is a sample CURL for performing single-factor authentication:
In response to this API request, you'll receive a JSON file that contains the token. Here's an example of such response:
where:
Parameter
Description
State
This is the state of the request. Usually the value is set to Succeeded
, meaning that the request has been successfully made.
Token
This is the token that must be provided in all subsequent API requests as the authentication bearer token.
Here are some of the common mistakes that developers make when requesting a token:
If you specify the wrong Et-App-Key parameter or fail to include it in the header altogether, you'll get the following error:
If you specify the wrong user credentials or fail to include them in the request header, you'll get the following error:
In the following article we provide in-depth coverage of the syntax for this API request.
To see how initial authentication can be performed in code, feel free to examine our in a dedicated article.