Get autoresponders
This method returns the autoresponders of the brand your API key belongs to, or of one of its lists. Autoresponders are read-only through the API; create and edit them in the app.
URL
https://dashboard.skry.be/api/autoresponders/get-autoresponders.php
PARAMETERS(POST)
api_keyyour API key.list_idonly return the autoresponders of this list. The encrypted id can be found under View all lists in the column named ID. (optional)
RESPONSE (JSON)
Success:
{
"autoresponders": [
{
"id": 3,
"name": "Welcome series",
"type": "drip",
"list_id": "Vg4f763Kq892Lm0aPz7xYw",
"custom_field": null,
"emails": 3,
"enabled_emails": 2
},
{
"id": 5,
"name": "Birthday wishes",
"type": "annually",
"list_id": "Vg4f763Kq892Lm0aPz7xYw",
"custom_field": "Birthday",
"emails": 1,
"enabled_emails": 1
}
]
}
idthe autoresponder's numeric idnameits nametypedrip(emails sent a set time after someone subscribes),annually(sent every year on a date custom field) oron_date(sent once, on a date custom field)list_idthe encrypted id of the list it belongs tocustom_fieldthe date custom field anannuallyoron_dateautoresponder sends on;nullfordripemailshow many emails it has, andenabled_emailshow many of those are enabled
Error: No data passed
Error: API key not passed
Error: Invalid API key
Error: Brand does not exist
Error: List does not exist
List does not exist is returned when list_id isn't one of the brand's lists.
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>");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://dashboard.skry.be/api/autoresponders/get-autoresponders.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>'
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://dashboard.skry.be/api/autoresponders/get-autoresponders.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);
});