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.

$ R4NKT_TOKEN="your API token"
$ curl https://api.r4nkt.com/v1/games/<your game id>/actions \
    -H "Authorization: Bearer $R4NKT_TOKEN" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

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:

{
   "data":[
      {
         "custom_id":"solve.puzzle",
         "name":"solve.puzzle",
         "description":"Solve any puzzle",
         "custom_data":null,
         "created_at":"2021-10-06T12:05:20.000000Z",
         "updated_at":"2021-10-06T12:05:20.000000Z"
      },
      {
         "custom_id":"open.chest",
         "name":"open.chest",
         "description":"Open any chest",
         "custom_data":null,
         "created_at":"2021-10-06T12:05:20.000000Z",
         "updated_at":"2021-10-06T12:05:20.000000Z"
      }
   ],
   "links":{
      ...
   },
   "meta":{
      ...
   }
}

Last updated