import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function getQueueHealth() {
const health = await client.message.getQueueHealth();
console.log(health);
}
getQueueHealth();curl -X GET \
https://api.periskope.app/v1/message/queues/health \
-H 'Authorization: Bearer <token>' \
-H 'x-phone: YOUR_PHONE_NUMBER'{
"waiting": 0,
"active": 1,
"completed": 142,
"failed": 3,
"delayed": 5,
"paused": 0
}Get Status of Message Queues
This endpoint returns the current status across all the message queue
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function getQueueHealth() {
const health = await client.message.getQueueHealth();
console.log(health);
}
getQueueHealth();curl -X GET \
https://api.periskope.app/v1/message/queues/health \
-H 'Authorization: Bearer <token>' \
-H 'x-phone: YOUR_PHONE_NUMBER'{
"waiting": 0,
"active": 1,
"completed": 142,
"failed": 3,
"delayed": 5,
"paused": 0
}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
"918527184400"
Response
200 OK
The response is a JSON object with a count of jobs per state in the message queue
Number of message jobs waiting to be processed
0
Number of message jobs currently being processed
1
Number of message jobs completed successfully
142
Number of message jobs that failed after all retry attempts
3
Number of message jobs scheduled for a future time
5
Number of message jobs currently paused
0
Was this page helpful?