Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function getQR() {
const response = await client.phone.getQR();
console.log(response);
}
getQR();curl -X GET \
https://api.periskope.app/v1/phones/qr \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
{}Phone APIs
Get QR
This endpoint retrieves the QR code of the phone (specified in the x-phone header).
-
Note: QR code will only be available when the phone is in a DISCONNECTED state
-
If the QR is not available, you can reset the phone to generate a fresh QR
Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function getQR() {
const response = await client.phone.getQR();
console.log(response);
}
getQR();curl -X GET \
https://api.periskope.app/v1/phones/qr \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Please provide the number of the phone you want to call with this API in the header. The number must be in country code + number format without any characters or spaces, e.g. 919876543210; Alternatively, provide the phone_id (phone-xxxxxxxxxxxx) in the header
Example:
"{{orgPhone}}"
Response
200 - application/json
The response is an image of the QR code
Was this page helpful?