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 getQueueJobs() {
const response = await client.queue.getJobs({
queue_id: '63cda77b-73de-433e-a652-a8f489100d43'
});
console.log(response);
}
getQueueJobs();curl -X GET \
https://api.periskope.app/v1/queue/jobs \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
[
{
"addedTimestamp": 1737373507280,
"attemptsMade": 1,
"attemptsStarted": 1,
"data": {
"body": "You have been invited to join Test Czech Republic\n\nhttps://chat.whatsapp.com/invite/B7NJcQ8qKR68G4CMHvSx9n. \n\nIf you cannot click the link, please respond to this message, and the link will become active",
"chat_id": "919537851844@c.us"
},
"finishedTimestamp": 1737373510691,
"id": "63cda77b-73de-433e-a652-a8f489100d43",
"message_id": "3EB0BB657AE18C4D3BB276DFB67F6CCA7DD13234",
"processedTimestamp": 1737373507380,
"stacktrace": [],
"status": "completed"
}
]Queue APIs
Fetch Queue Jobs
This endpoint returns the jobs currently in the 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 getQueueJobs() {
const response = await client.queue.getJobs({
queue_id: '63cda77b-73de-433e-a652-a8f489100d43'
});
console.log(response);
}
getQueueJobs();curl -X GET \
https://api.periskope.app/v1/queue/jobs \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
[
{
"addedTimestamp": 1737373507280,
"attemptsMade": 1,
"attemptsStarted": 1,
"data": {
"body": "You have been invited to join Test Czech Republic\n\nhttps://chat.whatsapp.com/invite/B7NJcQ8qKR68G4CMHvSx9n. \n\nIf you cannot click the link, please respond to this message, and the link will become active",
"chat_id": "919537851844@c.us"
},
"finishedTimestamp": 1737373510691,
"id": "63cda77b-73de-433e-a652-a8f489100d43",
"message_id": "3EB0BB657AE18C4D3BB276DFB67F6CCA7DD13234",
"processedTimestamp": 1737373507380,
"stacktrace": [],
"status": "completed"
}
]Deprecated. Use
POST /message/queues instead.
Pass queue_id or broadcast_id in the request body to filterAuthorizations
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}}"
Query Parameters
Provide the queue_id of the message to filter for that job
Example:
"63cda77b-73de-433e-a652-a8f489100d43"
Provide the broadcast_id to filter all messages of that broadcast
Example:
""
Response
200 - application/json
200 OK
The response is a JSON object of the message job. Refer to the message job object here
Was this page helpful?