Closed gr8tushar closed 9 months ago
Sure, it's possible! For now you can scan that image using client libraries and get the data
Hi, Any plans of implementing it in the near future?
The idea is to add a flag with expected format to /api/default/auth/qr
Get binary
?format=image
and header Accept: image/png
- it's value by default, returns the binary image
Get image in base64 encoding
?format=image
and header Accept: application/json
- base64 encoding of the JPEG QR image
{
"mimetype": "image/png",
"data": "base64-encoded-data"
}
Get raw data that QR contains - you need to render it on your side
?format=raw
- the raw value of the QR, so you can generate your own custom QR code without parsing the existed one.
{
"value": "value-of-qr-code-that-you-need-to-render-on-your-side"
}
~?format=url - save the QR in files and return URL back~ - decided to skip that for now, above cases covers like 99% cases
Hi! In 2023.12.1
release there'll be a way to get QR code in different formats.
https://waha.devlike.pro/docs/how-to/sessions/#get-screenshot
You can get QR in different formats:
GET /api/{session}/auth/qr
GET /api/{session}/auth/qr
and set Accept: application/json
headerGET /api/{session}/auth/qr?format=raw
Here's detailed information about each format:
# Get image - binary
GET /api/{session}/auth/qr
GET /api/{session}/auth/qr?format=image
GET /api/{session}/auth/qr?format=image Accept: image/png
2. **base64 image** - you'll get image in base64 format in response if you set `Accept: application/json` header.
```bash
GET /api/{session}/auth/qr?format=image
Accept: application/json
{
"mimetype": "image/png",
"data": "base64-encoded-data"
}
You can change it in Swagger by clicking on Media Type dropdown and selecting application/json:
GET /api/{session}/auth/qr?format=raw
{
"value": "value-that-you-need-to-use-to-generate-qr-code"
}
Hi, I was wondering if we can get the QR as text, something that is available in whatsapp-web.js. This helps in transferring the data to the client via the API. The client can use any library to convert this code to QR code.
Thanks, Tushar