Authentication
Get your access token
Before doing any other API calls you have to obtain an auth token. It's a standard JWT token carrying the following payload:
1
{
2
...
3
4
"iat": 1620967717,
5
"exp": 1621054117
6
}
Copied!
Tip: Use this handy website to parse the token contents: jwt.io
The token lifetime is 4 hours at this time. We might change this value in the future.
Warning! You can't login more than once per second. That's a DOS attack prevention feature.
To be more future-proof it is recommended to parse the token payload and compare current time to the token's expiration time. JavaScript code:
1
const seconds = JSON.parse(Buffer.from(token.split(".")[1], "base64url")).exp;
2
if (Date.now() >= seconds*1000) {
3
// get new token
4
}
Copied!
This login mutation is a subject to change in the future.

Getting a token

  1. 1.
    After we enable you, go to the https://api.flash-fx.com/ playground, click "DOCS" on the right to explore the possibilities.
  2. 2.
    Find there the login mutation. Execute it to obtain your access token. For example: mutation { login(input: {email: "YOUR_EMAIL" password: "YOUR_PWD"}) {token message} }
  3. 3.
    Click the "HTTP HEADERS" on the bottom and add this: {"authorization": "Bearer YOUR_TOKEN"}. Replace the YOUR_TOKEN with the token you just got.
  4. 4.
    Execute any other queries.
Here is an example of the login query.
Query
Response
1
mutation {
2
login(input: { email: "[email protected]", password: "12345678" }) {
3
token
4
message
5
code
6
success
7
}
8
}
Copied!
1
{
2
"data": {
3
"login": {
4
"token": "YOUR_TOKEN",
5
"message": "OK",
6
"code": "SUCCESS",
7
"success": true
8
}
9
}
10
}
Copied!
If using GraphQL Playground then click the "HTTP HEADERS" on the bottom left and paste there the following (replace the YOUR_TOKEN with the value you have just received form the above mutation):
1
{
2
"authorization": "Bearer YOUR_TOKEN"
3
}
Copied!
Last modified 4mo ago
Copy link