post
https://ssl.hot.co.zw/api/v3/identity/login
How to get a JWT Token from API
Overview
Correct credentials i.e., AccessCode and password will need to be supplied in order to get a bearer token. A bearer token and a refresh token is returned upon successful login. The bearer token will only be active for a period of time after which it will expire. One will need to refresh a token or login again to get a new token.
Authentication Request
| Field | Type | Description |
|---|---|---|
| AccessCode | string | Username used to log in to Hot Recharge account. This can be an email address or phone number. |
| Password | string | Password for logging in to Hot Recharge account |
{
"AccessCode": "0775438169",
"Password": "0123"
}
{
"AccessCode": "0775464462444",
"Password": "0"
}
Authentication Response Model
| Field | Type | Description |
|---|---|---|
| token | string | JWT Token for use in header for requests to endpoints |
| refreshToken | string | Refresh Token for use in refreshing token |
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0QGhvdC5jby56dyIsImp0aSI6IjFkNjI2YjkwLTJjZjctNGQyMC04NzllLTczODg1ZGQ0ZDliYSIsImVtYWlsIjoidGVzdEBob3QuY28uenciLCJpZCI6IjEyMzQ1NiIsIkFjY291bnRJZCI6IjEyMzQ1NiIsIm5iZiI6MTY5NDUwNDc0NywiZXhwIjoxNjk0NTA1MDQ3LCJpYXQiOjE2OTQ1MDQ3NDd9.7x0bZu8Q_Kxlvou_4TzXaiProbAnv2sYL1uwKxfGoWE",
"refreshToken": "GbJKHE7zww6Ng9vsbzmuo6G19k6aL+UxVox+ITeQz7E="
}
{
"errors": [
"User/password combination is wrong."
]
}
Have you tried it?
Don't forget to copy your token after trying it, you will need it later.
