The goal of this example is to show you what API calls to make so you can programmatically add a subscriber’s email (and other information) to a list at FeedBlitz. Let’s assume you’re developing a plugin for WordPress; any WP plugin developer should be able to integrate with FeedBlitz! The example below isn’t limited to plugins, of course; it can work with any web site, product or service you can extend programmatically. You use simple Web requests, so it’s pretty easy for a web developer to do.
The user of your plugin (your client) will need:
- A FeedBlitz premium account.
- At least one active mailing list.
- An active FeedBlitz API key from https://app.feedblitz.com/f?pl_api
Building Your Integration
Once you’ve validated the pre-reqs, you:
- Get a list of the publisher’s active lists from the REST API.
- Optionally get a list of custom fields and tags the publisher already has in FeedBlitz.
- In your configuration UI, the publisher:
- Picks a list that your plugin will subscribe visitors to.
- Optionally selects the custom fields to use, or specifies new ones using your UI.
When a visitor uses your plugin to join a list, you then:
- Present your UI, performing any necessary validation;
- Call the FeedBlitz Simple API to create the subscription
- Assuming all is well, FeedBlitz starts the dual opt-in process to add the subscriber.
IMPORTANT: Use the X-Forwarded-For Header
The X-Forwarded-For header in particular helps FeedBlitz determine the IP and other characteristics of the client. In a solution where the request chain is something like this:
Browser -> Your End User's Site -> Your Servers -> FeedBlitz
Then we ideally want to know the IP address of the host at the very far end, the browser. This is what x-forwarded-for delivers, and it is very good practice when interacting with APIs to provide / extend it as early as possible.