Get subscribers
This method returns a page of a list's subscribers, optionally only those in one state. Subscribers are returned oldest first, so paging through a list stays stable while people keep joining it.
URL
https://dashboard.skry.be/api/subscribers/get-subscribers.php
PARAMETERS(POST)
api_keyyour API key.list_idthe encrypted id of the list. It can be found under View all lists in the column named ID, or in theidreturned by Get lists.statusonly return subscribers in this state:active,unconfirmed,unsubscribed,bouncedorcomplained. Returns every state if left out. (optional)pagethe page to return, starting at1. Default is1. (optional)limithow many subscribers per page, from1to1000. Default is100. (optional)
RESPONSE (JSON)
Success:
{
"list_id": "Vg4f763Kq892Lm0aPz7xYw",
"status": "active",
"page": 1,
"limit": 100,
"total": 1520,
"subscribers": [
{
"email": "jane@example.com",
"name": "Jane Doe",
"status": "active",
"joined_at": 1715938800,
"custom_fields": {
"Birthday": "1990-05-17",
"City": "Lagos"
}
},
{
"email": "john@example.com",
"name": "",
"status": "active",
"joined_at": 1716025200,
"custom_fields": {
"Birthday": null,
"City": null
}
}
]
}
list_idthe list id you passedstatusthe status filter you passed, ornullpageandlimitthe page and page size usedtotalhow many subscribers match the filter, across all pages. There are more pages whilepage * limit < total.subscribersthis page's subscribers:statusone ofactive,unconfirmed,unsubscribed,bouncedorcomplained. Every subscriber is in exactly one state: a complaint outranks a bounce, which outranks an unsubscribe, which outranks being unconfirmed.joined_atwhen the subscriber joined, as a Unix timestamp (or, if no join date is recorded, when their record was last updated)custom_fieldsan object keyed by the list's custom field names. Empty values arenull;Datefields are formattedYYYY-MM-DDin your account's timezone.
Error: No data passed
Error: API key not passed
Error: Invalid API key
Error: List ID not passed
Error: Invalid status
Error: Invalid page
Error: Invalid limit
Error: List does not exist
Error: Unable to read subscribers
A list that belongs to another brand is reported as List does not exist.
EXAMPLES
Example request in JavaScript with fetch API
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
var urlencoded = new URLSearchParams();
urlencoded.append("api_key", "<YOUR_API_KEY>");
urlencoded.append("list_id", "<LIST_ID>");
urlencoded.append("status", "active");
urlencoded.append("page", "1");
urlencoded.append("limit", "100");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://dashboard.skry.be/api/subscribers/get-subscribers.php", requestOptions)
.then(response => response.text())
// Success is JSON; errors are plain text
.then(text => {
try { console.log(JSON.parse(text)); }
catch (e) { console.log('error', text); }
})
.catch(error => console.log('error', error));
Example request in JavaScript with axios
const axios = require('axios');
const qs = require('qs');
let data = qs.stringify({
'api_key': '<YOUR_API_KEY>',
'list_id': '<LIST_ID>',
'status': 'active',
'page': '1',
'limit': '100'
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://dashboard.skry.be/api/subscribers/get-subscribers.php',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});