Account

The API can be currently used to register a user or log in a user. Succesful registration or login will return a JWT token in the header that can be used to access portions of API that are yet to be implemented. The token is valid for 10 minutes.


Register a user

To register a user, send a POST request to the following endpoint:
https://dotnet-rest-api.fly.dev/register
The request body should contain the following JSON object:

{
 "login": "your username"
 "password": "your password"
}

The server will respond with a 200 OK status code, and a JSON object containing the following fields:


{
 "id": 123
 "username": "your username"
}

The token will be in the response header. The token will be used to access the API. It is valid for 10 minutes.


Log in a user

To log in a user, send a POST request to the following endpoint:
https://dotnet-rest-api.fly.dev/login
The request body should contain the following JSON object:


{
 "login": "your username"
 "password": "your password"
}

The response will be the same as for the registration endpoint.

  • Found here:
  • - Register
  • - Login