-
StampReady API
With the StampReady Main API, you're able to retrieve your Campaign Drafts, subscribers, etc. But also update or delete them. You can find your private API key on the account settings page in the dashboard.
We're currently working on this feature, the final API may look different.
The StampReady endpoint should look something like this: http://www.stampready.net/api/3.0/api.php?private_key=XXX&function=XXX
Functions
-
getDraftsapi.php?private_key=XXX&function=getDrafts will return an array of the campaign id, name and the date.
-
getListsapi.php?private_key=XXX&function=getLists will return an array of the list id, name, list encryption key, unsubscribe page and the vip quota.
-
getSubscribersapi.php?private_key=XXX&function=getSubscribers&list=XXX will return a comma separated array of the email addresses.
-
getCampaignHTMLapi.php?private_key=XXX&function=getCampaignHTML&id=XXX will return an array holding the HTML of a campaign.
-
deleteSubscribersapi.php?private_key=XXX&function=deleteSubscribers&list=XXX with a required POST of an array of email addresses that need to be deleted.
array = ["john@doe.com", "john2@doe.com"] -
deleteCampaignsapi.php?private_key=XXX&function=deleteCampaigns with a required POST of an array of campaign id's that need to be deleted. The example array would looks like this:
array = ["12345", "67890"] -
addSubscribersapi.php?private_key=XXX&function=addSubscribers&list=XXX with a required POST with an array of values that need to be added. The example jQuery array would look like this:
array = [[“Email Address”, ”My Name”, “The Country”, “The Referrer”, “The OS”, “The Browser”, “1"]];
The last attribute is whether it should reflect to your Subscribers Analytics. It is common you want to add subscribers, without the analytics to show ‘tons of new subscribers today’. 0 will reflect.
- Opted out subscribers won't be inserted. If this happens, the API simply moves to the very next item in the array.
- Duplicated entries will be ignored.
Ideally for cURL and PHP, you'd need to push the array in an array, for future purposes. -
jQuery Example for addSubscribers function.Download a full working example here. (change private key and list name in .JS file)
-
CURL + PHP Example for addSubscribers function.Download an example here. (change private key and list name in .PHP file)
-
-
-
Subscribers API
You need an active subscription in order to use this.
In case you're running version 1.0, make sure to change the URL to version 2. It'll work the same, but it contains more features and it's more stable due to the frequent updates. The biggest improvement with version 2.0 is that you'll be able to send out a custom email when someone signs up, or verifies, including personalization tags.
It's pretty straightforward. Make sure to have the jQuery Javascript framework correctly installed on your website. Next, install the StampReady API JS library right below. Those two libraries are crucial in order to have it work.
At minimum we require 2 elements. An input field where visitors can leave their email address and a submit button, containing the submit function. You may attach extra paramaters to this button. Have a look at the full example on the right.
Form Attributes
-
apiYour public api key.
-
listThe encryption of your list can be found on the Form Editor page. Click Embed & USE > Get Embed URL > Show only encryption list key and API key
-
opt optionalWether or not verification is required. A custom email can be sent when the to true. Set to false or completely remove the attribute to ignore verification.
-
register-email optionalThis parameter is to say 'Hey, thank you for registering!'. The absolute path to the layout of your email which subscribers receive when they subscribed.
This function costs 1 StampReady credit. -
register-email-subject optionalThe subject of the email when a subscribers signed up.
-
verify-email optionalThis parameter is for the subscriber to confirm he or she is real. The absolute path to the layout of your email which subscribers receive when they have confirmed.
This function costs 1 StampReady credit. -
verify-email-subject optionalThe subject of the verified email.
-
verify-page optionalThe page they see when they have verified their sign up.
-
sender-address optionalThe address the emails are sent from.
-
sender-name optionalThe name of the sender address the emails are sent from.
The following are the Javascript functions you can use when the subscriber submitted the form.
Callbacks
-
success()Triggers when the subscriber successfully signed up.
-
exists()Triggers when the email address already exists in your list.
-
error()Triggers when something gone wrong. For example the wrong list encryption or name.
-
confirm()Triggers when it's a success, but the subscriber needs to confirm by email.
The following are tags you can use in your verify & confirm email layouts.
Subscriber Template tags
-
sr_listThe name of the list they have subscribed to.
-
sr_emailThe email address of the subscriber.
-
sr_nameNot required, but if set, the full name of the subscriber.
-
sr_first_nameNot required, but if set, the first name of the subscriber.
-
sr_dateNot required, but if set, the current date of the day.
-
sr_confirm_linkNot required, but if set, this tag populates in the link people confirm their registration.
-
-
The StampReady subscriber API requires the jQuery framework.
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>StampReady Subscriber API 2.0</title> <!-- Jquery Framework --> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <!-- API 2 --> <script type="text/javascript" src="https://www.stampready.net/api2/api.js"></script> <script> /* error: Something went wrong, either by you or our server. exists: The email address already exists in your list. success: Subscribing succeeded! confirm: The subscriber needs to confirm by email before he will appear in your list. For test email layouts, simply point your parameters to: verification-email: https://www.stampready.net/api2/example/confirm/index.html register-email: https://www.stampready.net/api2/example/register/index.html **************************************************** Required are: email, api & list. The other parameters are completely optional. If you do not use the other parameters, simply remove them. Do not keep them attached to your form. Verification/confirm is also not required. **************************************************** For more information see: https://www.stampready.net/developer/ */ function error() { alert("error"); } function exists() { alert("exists"); } function success() { alert("success"); } function confirm() { alert("Please, confirm by email"); } </script> </head> <body> <!-- Subscriber Name --> <input type="text" name="sr_name" placeholder="Your Name"> <!-- Subscriber Email Address --> <input type="text" name="sr_email" placeholder="Your Email"> <!-- Submit Button containing your parameters --> <input type="submit" value="Register" api="XXXXX" list="XXXXX" opt="true" register-email="https://www.stampready.net/api2/example/register/index.html" register-email-subject="Subject of registered email" verify-email="https://www.stampready.net/api2/example/confirm/index.html" verify-email-subject="Subject of verification email" verify-page="website address" sender-address="my@email.com" sender-name="My Name" onclick="submit();"> </body> </html>