r4nkt
Search…
Authentication

Get your API token

Once you are logged in to your dashboard navigate to API access and create an API token.
You can name your token, so you know where this one is going to be used, in case you ever need to revoke it.

r4nkt API access

Once you create a token, it will be shown only once to you. Make sure to store it safely. After it is shown it can only be revoked, in which case you will need to generate a new token for use.
Once you have your token, you can authenticate against the API.

Authenticate against the API

The token you've received can be used in the Authorization header.
Here's a curl example of how you can authenticate against the API. In this example, it will list all of your game's actions.
1
$ R4NKT_TOKEN="your API token"
2
$ curl https://api.r4nkt.com/v1/games/<your game id>/actions \
3
-H "Authorization: Bearer $R4NKT_TOKEN" \
4
-H "Accept: application/json" \
5
-H "Content-Type: application/json"
Copied!
The token is used to authenticate. The /v1/games/<game_id>/actions endpoint is hit to retrieve your game's actions. The resulting response payload might look like this:
1
{
2
"data":[
3
{
4
"custom_id":"solve.puzzle",
5
"name":"solve.puzzle",
6
"description":"Solve any puzzle",
7
"custom_data":null,
8
"created_at":"2021-10-06T12:05:20.000000Z",
9
"updated_at":"2021-10-06T12:05:20.000000Z"
10
},
11
{
12
"custom_id":"open.chest",
13
"name":"open.chest",
14
"description":"Open any chest",
15
"custom_data":null,
16
"created_at":"2021-10-06T12:05:20.000000Z",
17
"updated_at":"2021-10-06T12:05:20.000000Z"
18
}
19
],
20
"links":{
21
...
22
},
23
"meta":{
24
...
25
}
26
}
Copied!
Last modified 1mo ago