Authentication¶
Authenticate your account by including your JWT key in API requests. You can create your JWT keys by using JWT /jwt/ endpoint. Your JWT keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such GitHub, client-side code, and so forth.
The token generated has a validity period of 24 hours. It is advisable to cache or store the token and utilize it until its expiry.
Getting JWTs¶
-
POST
/jwt/
¶ Creates JSON Web Token to authenticate yourself on API endpoints.
Status Codes: - 200 OK – no error, JWT created
- 400 Bad Request – there’s no user
Example request:
POST /jwt/ HTTP/1.1 Host: api.connexease.com Accept: application/json { "username": "john.doe", "password": "awesomepassword" }
Example successful response:
HTTP/1.1 200 OK Content-Type: application/json { "token": "awesomejwttoken", "account": { "uuid": "c7617c90-0eef-4c75-b604-bdfbc152437c" }, "otp": false, "client": { "device_id": "deviceId" } }
Example failed response:
HTTP/1.1 400 Bad Request Content-Type: application/json { "non_field_errors": [ "Could not logged in with provided fields." ] }