A valid token is required to use most of the APIS. Tokens can be obtained by submitting user credentials to our generic endpoint. Tokens have a duration of 180mins of inactivity, so whenever a token is used to consume an API the token expiration timer starts again. Tokens are completely random and unique UUIDs that should be stored locally until expired, and then a new login will help obtain a new token. Each login resets any previous token.
{ "action" : "doLogin", "email" : "John.doe@domain.com", "pass" : "5F4DCC3B5AA765D61D8327DEB882CF99", "countryState" : "MX,CMX", "mode" : "worker", }
Important notes:
- mode can be either "worker" or "client", based on the app or user mode you need.
- Password should be Hashed (MD5), this is different to the B64 of when the account was created
- countryState is the same as mktHandle, it should be a valid/active item from "getMarkets"
- ActivationMail is triggered upon first successful login.
If Successful, you will receive a response with a token structure and a token value.
{ "success":true, "data" : { "appid":1, "expiry":"2021-02-12 23:54", "userid":1, "tokenid":"FD163B01-96CF-C6DD-5B0D3B0836F1A26C" } }
Else you can receive one of the following error codes:
BLOCKED | When the account has been suspended by us |
NONE | When the email account is not registered |
INVALID | When the supplied credentials are invalid |
MKTHANDLE | When the market is required and not supplied |
NOMKT | When the selected market is not operational |
EXPIRED | comes from OTHER apis, when trying to use token which is expired |
Password Recovery
In order to send a mail to the user with its password, simply follow this example with a valid email and mode
{ "action" : "getPassword", "mode" : "worker", "email" : "John.doe@mail.com" }