TypeScript
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: '919876543210', // the phone to act with (x-phone)
});
async function main() {
const response = await client.phones.getPhoneQr();
console.log(response);
}
main();curl -X GET 'https://api.periskope.app/v1/phones/qr' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." />
Phone APIs
Get QR
Returns the QR code of the phone as an HTML page with an inline PNG. Scan it with WhatsApp (Settings > Linked Devices) to connect.
TypeScript
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: '919876543210', // the phone to act with (x-phone)
});
async function main() {
const response = await client.phones.getPhoneQr();
console.log(response);
}
main();curl -X GET 'https://api.periskope.app/v1/phones/qr' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." />
Authorizations
Headers
Response
HTML page with the QR code as an inline base64 PNG image
HTML snippet containing the QR code as an inline base64 PNG image. Open it in a browser and scan it with WhatsApp (Settings > Linked Devices) to connect.
Example:
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...\" />"
Was this page helpful?