Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section describes the API method of the WIFI platform used to authenticate and obtain the API Token that must be sent in all requests made to the API.

Table of Contents


GET - Return  Return API_Token

Returns the token for the user and password indicated in the header using the Authorization parameter. This token must be included in all subsequent requests to be able to validate the user.

Code Block
https://<server-domainname>/rest/login


Parameters


TYPE

Parameter

Significance

Type

Required

Default

HEAD

Atuhorization

Username and password in basic auth format

string

YES

-

The user and password must be sent encrypted in Base64. The steps to follow in order to build the content to be sent in the Authorization parameter are:

...

For example, for the user USER and password PASSWORD, we would get the string USER:PASSWORD. Then it is coded in base64 as VVNFUjpQQVNTV09SRA==, so the request to obtain the Access Token for this user would be as follows:

Code Block
curl -D- -X GET -H "Authorization: Basic VVNFUjpQQVNTV09SRA==" -H "Content-Type: application/json" "https://<server-domainname>/rest/login"


Response

HTTP CODE

Result

Response data

200

Ok


Code Block
[
    "api_key",
    "203BB1A4690CAD"
]

400

Bad Request

Incorrect params, not o malformed header

401

Unauthorized

Password incorrect

403

Forbidden

User not exist