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 getQueueStatus() {
const response = await client.queue.getStatus();
console.log(response);
}
getQueueStatus();curl -X GET \
https://api.periskope.app/v1/queue \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
{
"active": 0,
"completed": 16,
"failed": 10,
"is_running": true,
"pending": 0
}Queue APIs
Get Queue Status
This endpoint returns the current status of the message queue
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 getQueueStatus() {
const response = await client.queue.getStatus();
console.log(response);
}
getQueueStatus();curl -X GET \
https://api.periskope.app/v1/queue \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
{
"active": 0,
"completed": 16,
"failed": 10,
"is_running": true,
"pending": 0
}Deprecated. Use
GET /message/queues/health insteadAuthorizations
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
200 OK
The response is a JSON object with details about the queue running status and a summary count of the job status in the last 24 hours
-
is_running-
If this is true, the queue is running.
-
Reverts to false when the phone connection is DISCONNECTED
-
-
active- The number of jobs currently being processed by the queue
-
completed- The number of jobs completed successfully in the last 24 hours
-
failed- The number of jobs that failed in the last 24 hours
-
pending- The number of jobs currently waiting in the queue
Was this page helpful?