WhatsApp Login
Use the WhatsApp Login API to authenticate a WhatsApp Business account and receive a JSON Web Token (JWT) for authorized API requests.
Endpoint details
| Field | Value |
|---|---|
| Method | POST |
| URL | https://apis.rmlconnect.net/auth/v1/login/ |
| Request format | JSON |
| Response schema | application/json |
By default, the JSON Web Token (JWT) validity periods are set to one hour.
How login works
- Send the account
usernameandpasswordin the request body. - If the credentials are valid, the API returns
JWTAUTH, the JSON Web Token used for authentication. - Use
JWTAUTHto authenticate subsequent authorized API requests. - Re-authenticate after the token expires.
Request body
{
"password": "password",
"username": "username"
}Include the following fields in the request body:
| Field | Required | Type | Description |
|---|---|---|---|
username | Yes | String | Your account username. |
password | Yes | String | Your account password. |
Responses
201 Created
| Detail | Description |
|---|---|
| Response category | Success |
| Response schema | application/json |
| Description | The login request is successful. Returns JWTAUTH, the JSON Web Token used for authentication, and user_data, which contains the user account details. |
Example response
{
"JWTAUTH": "XXXX",
"user_data": {
"username": "demo",
"first_name": "First_Name",
"last_name": "Last_Name",
"email": "{email}",
"phone_number": "+XXXXXXXXXXXX",
"password_reset": false,
"is_active": true,
"is_staff": false,
"ip": "1stepauth",
"child_user": false,
"parent_username": ""
}
}| Field | Type | Description |
|---|---|---|
JWTAUTH | String | JSON Web Token Authentication. |
user_data | Object | User account details returned after successful login. |
403 Forbidden
| Detail | Description |
|---|---|
| Response category | Authentication error |
| Response schema | application/json |
| Description | The username or password is invalid, or the account has been deactivated. Returns status with the message invalid credentials or the account has been deactivated. |
Example response
{
"status": "invalid credentials or the account has been deactivated"
}| Field | Type | Description |
|---|---|---|
status | String | The user login status. |
500 Internal Server Error
| Detail | Description |
|---|---|
| Response category | Server error |
| Response schema | application/json |
| Description | The server encounters an unexpected error while processing the login request. Returns status with the exception message. |
Example response
{
"status": "<exception>"
}| Field | Type | Description |
|---|---|---|
status | String | The user login status. |
Updated 12 days ago
Did this page help you?