Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

Instructions

Sommaire
minLevel2
exclude.*Disclaimer.*

POST {url}/localtrac/login

The authentication is used to obtain a valid token that your application will use to connect to any routes of the API. The token has a shelf life of 15 minutes starting at the moment of acquisition, after which it must be re-acquired. When you use the token in a request, you are connected on behalf of the the user provided during the authentication and are restricted to the limitation of this user (see users roles and their permissions).

Request

Headers

Accept

application/json

Content-type

application/json

Body

Bloc de code
languagejson
{
	"username": <(string) username>,
	"password": <(string) password>
}

username

Username of the user to connect on behalf-of

password

Password of the user

Response (200) - Success

Headers

Content-type

application/json

Cache-Control

no-cache,private

Body

Bloc de code
languagejson
{
  "success": true,
  "token": <(string) token>
}

success

Token has been acquired

token

The token to use within the Authorization header for the request

Response (401,503) - Authorized access

Headers

Content-type

application/json

Cache-Control

no-cache,private

Connection

close

Body

Bloc de code
languagejson
{
  "code": <(string) code of error),
  "message": <(string) message of error)
}

code

Error codes:

  • 401.unauthorized: When providing wrong credentials or token expired

  • 503.maintenance : When the server is currently on maintenance

message

Developer-friendly description of the code of error. Ex: “Invalid credential provided”

...