1. Home
  2. Docs
  3. Simple API
  4. Example: Building a PHP P...
  5. Development Outline

Development Outline

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.

Prerequisites

The user of your plugin (your client) will need:

Building Your Integration

Once you’ve validated the pre-reqs, you:

  1. Get a list of the publisher’s active lists from the REST API.
  2. Optionally get a list of custom fields and tags the publisher already has in FeedBlitz.
  3. In your configuration UI, the publisher:
    1. Picks a list that your plugin will subscribe visitors to.
    2. 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:

  1. Present your UI, performing any necessary validation;
  2. Call the FeedBlitz Simple API to create the subscription
  3. 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.