Skip to main content
GET
/
app
/
login
Login with QR Code
curl --request GET \
  --url https://api.example.com/app/login \
  --header 'Authorization: <authorization>'
{
  "500": {},
  "code": "<string>",
  "message": "<string>",
  "results": {
    "qr_duration": 123,
    "qr_link": "<string>"
  }
}
Initiate the login process by generating a QR code that can be scanned with your WhatsApp mobile app.

Authentication

Authorization
string
required
Basic authentication credentials (username:password in base64)

Headers

X-Device-Id
string
Device identifier for multi-device support. Required when multiple devices are registered. If only one device is registered, it will be used as the default.

Response

code
string
Response code indicating success or failureExample: SUCCESS
message
string
Human-readable response messageExample: Success
results
object
Login response data
qr_duration
integer
Duration in seconds that the QR code is validExample: 30
URL to the generated QR code imageExample: http://localhost:3000/statics/images/qrcode/scan-qr-b0b7bb43-9a22-455a-814f-5a225c743310.png

Example Request

curl -X GET 'http://localhost:3000/app/login' \
  -u 'username:password' \
  -H 'X-Device-Id: my-device-id'

Response Example

{
  "code": "SUCCESS",
  "message": "Success",
  "results": {
    "qr_duration": 30,
    "qr_link": "http://localhost:3000/statics/images/qrcode/scan-qr-b0b7bb43-9a22-455a-814f-5a225c743310.png"
  }
}

Error Responses

500
object
Internal Server Error
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "you are not logged in",
  "results": null
}

Usage Notes

  • The QR code expires after the duration specified in qr_duration
  • Scan the QR code with WhatsApp on your mobile device to authenticate
  • Once scanned successfully, your session will be established
  • The device will remain logged in until you explicitly logout

Build docs developers (and LLMs) love