Using Sendy API for a Dashboard

Sendy API for Dashboard Metrics

The documented cases to use the Sendy API are few, but in our case we use it every 5 minutes. In my company we don’t run a bunch of mysql statements to get information from the database. We don’t track our Facebook likes, Twitter followers, or any other important metric with a manual check.  Instead we simply write a script and dump that information into Graphite. If you aren’t familiar with Graphite and Grafana, get on board if you like having a dashboard to reference for metrics at a glance.

Sendy API Subscriber Growth in Grafana

I would like to share the method I am using to create the graph you see above. The code being used is

#set -x
DATE=`date +%s`
subscribers=$(curl -X POST -H "Content-Type: multipart/form-data" -F "api_key=YOURAPIKEY" -F "list_id=YOURLISTID" "")
echo "$subscribers"
echo "collectd.sendy-metrics.numberOfsubs $subscribers $DATE" | nc $GRAPHITE $GRAPHITE_PORT

On your server, if you create this as a shell script and update the fields specified above you will be able to get a subscriber count back from the Sendy API.

You should already know the URL for your installation but I will explain how to get the api_key and the list_id from your Sendy install.

Your Sendy API key can be found by going to your Sendy URL and logging in. In the upper right hand corner, select your name and then settings. Directly under the settings menu, you will see your key. You can copy this and put it into your script.

Screenshot 2016-06-04 16.26.43

Your ListID should be easier to get than it currently is, but it still isn’t hard. Click on the Brand you manage, then click Lists. Put your mouse over the ID field and it will give you the ListID so you can use it in your script

Screenshot 2016-06-04 16.29.43

Your script will need to made executable but after updating the fields, you will be able to get the number of subscribers for your list. In my script I am putting the value in to Graphite and then displaying growth. The script is running every 5 minutes and gives us a great dashboard for metrics at a glance. Quite handy if you would like to see your list growth outside of the Sendy UI.

One thought on “Using Sendy API for a Dashboard

  1. As a marketer, the idea of starting a new email newsletter is fulfilling and exciting. However, the excitement is overwhelmed by the price of popular email newsletter apps. It may look cheap when starting out, but later, the price escalates as the number of subscribers reaches thousands. But when you bring Sendy email marketing solutions into the picture, you can enjoy many amazing features.

Leave a Reply