Authentication
Register an account, sign into the account, and obtain a token.
Preparation
You don't need to set up anything! Any runtime or language you are already using is capable of sending HTTP requests, so simply use what you are familiar with.
All examples will be written as cURL requests. This format is easy to run in terminal, import into HTTP clients, and all AI agents understand it, so you can easily convert it into your preferred programming language.
Here is an example of a cURL request:
curl -X GET https://api.http-games.almostapps.eu/v1/healthAfter running the command, you should see a response similar to this:
{
"status": "ok"
}Signing Up
To register an account, send an HTTP request with email, password (twice), and a nickname.
Email is used only for authentication purposes, so it will not be publicly displayed. Only your nickname will be public.
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"email": "user@example.com",
"nickname": "User123",
"password": "password",
"passwordConfirmation": "password"
}' \
https://api.http-games.almostapps.eu/v1/usersObtaining a Token
Ensure you have signed up first, and you remember your email and password.
To obtain a new token, send an HTTP request with your credentials.
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"email": "user@example.com",
"password": "password"
}' \
https://api.http-games.almostapps.eu/v1/tokensSending Authorized Requests
In all requests sent when playing games, you will need to provide your token's secret in Authorization header.
Authorization: Bearer sk_Guei2HJgU...If you haven't yet obtained a token, follow Signing up and Obtaining a token sections.
To test this out, you can send a request to get details about your account. This request can only succeed if you have a valid token of a valid user.
curl \
-X GET \
-H 'Authorization: Bearer sk_Guei2HJgU...' \
https://api.http-games.almostapps.eu/v1/users/[YOUR_USER_ID]Remember to update URL with your user ID. If you don't remember it, refer to Obtaining a token section, since a response of a new token includes your user ID too.
You have successfully opened your account, signed in, and made your very first authenticated request! You are now ready to play HTTP games.