Subscribe
This method adds a new subscriber to a list. You can also use it to update an existing subscriber's name and custom fields. If you'd rather embed a subscribe form on your website, open View all lists, select your list, then click Subscribe form at the top of the page.
URL
https://dashboard.skry.be/subscribe
PARAMETERS(POST)
You can also set or update custom fields. Use the field's name, with any spaces removed, as the parameter name (it is case-sensitive): for a field named Birthday, pass Birthday; for a field named Favourite colour, pass Favouritecolour. For date fields, YYYY-MM-DD is the safest format; dates with slashes are read month first (5/6/2024 is May 6), and a value that can't be read as a date is stored empty. Get list returns a list's custom fields.
api_keyyour API key. It must belong to the same brand as the list.emailthe subscriber's email address.listthe encrypted id of the list to subscribe the user to. It can be found under View all lists in the column named ID.namethe subscriber's name. (optional)countrythe subscriber's 2-letter country code, in capitals, eg.US. (optional)ipaddressthe subscriber's IP address. (optional)referrerthe URL the subscriber signed up from. (optional)notesnotes to store with the subscriber. (optional)gdprif you're signing up EU users in a GDPR-compliant manner, set this totrue. (optional)silentset this totrueif your list is double opt-in but you want to skip the confirmation email and sign the user up as single opt-in instead. (optional)hpa honeypot field for spambots. Leave it out of your own calls: if it has any value, the call is rejected asInvalid email address.(optional)booleanset this totrueto get a plain-text response. Without it, the response is an HTML page meant for people submitting a form (or a redirect to the list's subscribed URL). Always pass it when calling the API from code.
RESPONSE (Plain text)
Success: 1
Error: Some fields are missing.
Error: Invalid email address.
Error: IP address is invalid.
Error: Country must be a valid 2 letter country code
Error: Referrer is not a valid URL
Error: Bounced email address.
Error: Invalid list ID.
Error: API key not passed
Error: Invalid API key
Error: Already subscribed.
Error: Email is suppressed.
Already subscribed. is returned when the address is already a confirmed, subscribed member of the list. The subscriber's name and custom fields are still updated with the values you passed, so this response also means an update went through.
Bounced email address. is returned for an address that has hard-bounced, and Email is suppressed. for an address (or domain) on the brand's suppression or blocked-domain list.
The success response is 1, not true.
EXAMPLES
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("name", "Jane Doe");
urlencoded.append("email", "jane@example.com");
urlencoded.append("list", "<LIST_ID>");
urlencoded.append("boolean", "true");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://dashboard.skry.be/subscribe", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
const axios = require('axios');
const qs = require('qs');
let data = qs.stringify({
'api_key': '<YOUR_API_KEY>',
'name': 'Jane Doe',
'email': 'jane@example.com',
'list': '<LIST_ID>',
'boolean': 'true'
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://dashboard.skry.be/subscribe',
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);
});