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

FieldValue
MethodPOST
URLhttps://apis.rmlconnect.net/auth/v1/login/
Request formatJSON
Response schemaapplication/json

By default, the JSON Web Token (JWT) validity periods are set to one hour.

How login works

  1. Send the account username and password in the request body.
  2. If the credentials are valid, the API returns JWTAUTH, the JSON Web Token used for authentication.
  3. Use JWTAUTH to authenticate subsequent authorized API requests.
  4. Re-authenticate after the token expires.

Request body

{
  "password": "password",
  "username": "username"
}

Include the following fields in the request body:

FieldRequiredTypeDescription
usernameYesStringYour account username.
passwordYesStringYour account password.

Responses

201 Created
DetailDescription
Response categorySuccess
Response schemaapplication/json
DescriptionThe 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": ""
  }
}
FieldTypeDescription
JWTAUTHStringJSON Web Token Authentication.
user_dataObjectUser account details returned after successful login.
403 Forbidden
DetailDescription
Response categoryAuthentication error
Response schemaapplication/json
DescriptionThe 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"
}
FieldTypeDescription
statusStringThe user login status.
500 Internal Server Error
DetailDescription
Response categoryServer error
Response schemaapplication/json
DescriptionThe server encounters an unexpected error while processing the login request. Returns status with the exception message.

Example response

{
  "status": "<exception>"
}
FieldTypeDescription
statusStringThe user login status.


Did this page help you?