Salsa Scoop> tag: ”blog:api“

Adding a Salsa signup box to Facebook

by Jason Z.

The Salsa Labs Facebook page -- you are a fan already, yes? -- just incorporated an email signup form, and you might be interested in knowing the trick for your own page.

Though the example here incorporates a regular signup page into Facebook, the same technique could be used to embed event registrations, petition signatures, or other forms of action (but passing donations is a different matter, and this kind of form won't dialogue with the Salsa data warehouse for a congressional district lookup without much more intensive spadework than I've described here).

1. Get the Static FBML app

This extremely handy application lets you build a box or a tab with straight HTML (or, with Facebook's own Facebook Markup Language syntax). No programming skills needed.

Just search it up, and add it to your organization's page.

Add Static FBML to my page's favorites graphic

2. Get the form code of a Salsa signup page

Now that you're able to add some HTML to your Facebook page, all you have to do is get your mitts on some usable HTML.

No problem.

There are a couple of ways to do this, depending on your coding skills. While developers can dig as deep as they dare, the best choices for duffers like myself are:

  1. Build a signup page (or other type of page) in Salsa. (In this case, I just used one of our standard signup pages.) View the end-user page, hit "View Source" to see its HTML, and copy the
    tags and everything between them.
  2. Alternatively, hit the "Developer Resources" link at the bottom of any page in your Salsa headquarters to find some generic ready-for-copy-and-paste code for an external signup form, as shown below. Then, copy and paste that code.

3. Create an email signup form in Facebook

Now that we've got the code on the clipboard, back to Facebook.

Open up your organization's Facebook page -- we're assuming here that you have admin privileges -- and click "Edit Page". In the screen that follows, find FBML, as shown:

Then, just click the "Edit" button (highlighted) to go to work.

Title your box whatever you'd like (unimaginately, I went with "Email Signup"), then paste all that signup form text into the "FBML" box.

4. Add the form to your Facebook page

Now, it's just a matter of adding the tab to your Facebook page, which you can do the same way you customize that page with any other new tab.

You'll also find your new Static FBML creation under the "Boxes" tab, where you can select it and optionally send it to the sidebar of your wall, as I've done. That makes the form visible to anyone who lands on your page.

5. Tweaks and Troubleshooting

You should be ready to go! Test the form out and see how it works, then fine-tune accordingly. People who use it should land (immediately) in your Salsa headquarters; the form will have no effect on their Facebook profile, your Facebook page, or anything else within Facebook itself.

Here are a few things you might want to take notice of:

  • Make sure the form action is right. Depending on where you copy the code, you might have a relative url, which won't work in Facebook. You'll want a full url, and you can find the right one for your organization by checking the Developer Resources section discussed above. Put it right at the start of the form.
    form action="http://YOUR NODE ADDRESS/dia/api/process.jsp" method="post"
  • Especially if you're going to place it on your wall, make sure it's reasonably succinct. Space is at a premium.
  • If you're fussy about your graphic design, you can crib Facebook's styling colors here, which I did on mine to make the "Join these email list(s)" header look Zuckerberg-blue.
  • Consider your redirect path (I used none, so that list joiners just stay on the Facebook page; you might have other ideas) and acknowledgment triggers.
  • If you want to be rigorous about tracking, you might also consider passing a Source_Details value, tag values, group affiliations, or other elements. You should be able to crib code for this sort of thing by building it in a normal signup page in Salsa; ask at Salsa Commons if you're stuck.

(Note: this is not the Facebook Connect integration recently mentioned in these pages. But that integration is still coming!)

Read more (3 comments)

Merchant gateways in the news

by Jason Z.

Users of the popular merchant gateway Payflow Pro may be contacted by PayPal to advise of changes to the processor's API.

Those changes are slated to take effect in September, and they will affect the way Salsa interacts with PayPal -- but if you run your own Payflow Pro gateway, there's nothing to sweat about.  We're on the case, and already have the initial coding done; we should be set for a seamless transition well before September.'s default merchant processor -- the one used by the majority of its member organizations -- is also Payflow Pro, so we're thoroughly incentivized.

In a completely unrelated merchant gateway bulletin, the product formerly known as Linkpoint or YourPay is now First Data Global Solutions. (Both and loudly banner this confusing development.)

We're going to need a playbill just to keep track of the dramatis personae.  Fortunately, you probably don't use Linkpoint, YourPay, and/or First Data Global Solutions:  while it is a supported merchant gateway in Salsa, it's the least frequently chosen.

Read more (12 comments)

Another Salsa API Integration

Since we're on about APIs lately, the Development Seed blog's description [warning: geeky] of using our API to internationalize by melding Salsa and Drupal is a timely comment. Beautiful.

Read more (2 comments)

The Great Awakening

'My son,' the father said, 'you are always with me, and everything I have is yours. But we had to celebrate and be glad, because this brother of yours was dead and is alive again; he was lost and is found.' -Luke 15:31-32 It's time to slay the fatted calf. As a hybrid nonprofit/tech provider, DIA's animating vision has always been empowering nonprofits. Open APIs have been a bedrock assumption of that understanding since day one: as our guy put it on last year's Open API debate, "nonprofits can do more than vendors can imagine they can do". Kintera and Convio just got a little religion, too. And since we're not above glorying in converts, we're excited to see the big commercial players starting to come around. Judi Sohn and Michelle Murrain have more about those announcements. Allan Benamer has some thoughts from a coders' standpoint. Personally, I'm pretty much in Beth's boat -- "wouldn't know an API from Ape if it stood right in front of me beat its chest".
Above: an image capture of a third-party application that increments a counter based on data pulled from our API
But I've seen some groups use our API to do some pretty cool stuff, often stuff we had no idea they were doing. Mashing up with outside applications, custom data sets and (of course) Google maps. Radically customizing pages -- even reworking DIA-hosted pages. Content management integration. Arranging custom database syncs.

Read more (7 comments)

The Ins and Outs of Salsa's API

I first came across Salsa's API quite by accident. As the lead programmer for TriggerID, I was looking to try and integrate one of our products, CampaignWindow, with Salsa for the Young Democrats of America. Many YD chapters around the country are using CampaignWindow for their web presence but also use Salsa (known internally as DEMopolis) for their membership lists, etc. In poking around Salsa I noticed it had a link in the footer for Developers which contained cut-and-paste code for a form clients could use on their site to add users. Wondering if I might be able to automate this, on a hunch I did a Google search for "DIA API" and came across this. [The non-Google path to our documentation hive is here. -ed.] This was a gold mine, listing all tables and associated field names, and though the documentation was all geared towards how to interface with your data via web forms, I decided to try and see if a silent HTTP POST would work too. Setting up a test was easy enough, but due to not knowing one crucial piece of information, it didn't work and I spent several hours trying to figure out what I did wrong. Here's the initial code (in ColdFusion):

Read more (27 comments)

DIA Plans to Integrate with Drupal, PHP, and more

Democracy In Action is building a Salsa connectivity module for the open source CMS Drupal, but that's only part of the picture. We are actively collaborating with our user and developer communities to provide open APIs and libraries so that external systems can leverage and integrate the open structure of Salsa and DIA's high-performance CRM services. This collaboration has already yielded a number of successes -- DIA tools have been integrated with Drupal and Plone, and a comprehensive set of PHP libraries is close to release -- but we want to work with our community to provide tools for all of the languages that they use. If you are a developer hoping to integrate Salsa and DIA services with Ruby on Rails, Python, Perl, .NET, or anything else, let's work together to keep growing the progressive community's best set of online engagement tools!

Read more (231 comments)

DIA Integrates with Myspace? You bet!

You can create a custom sign up box for your Myspace page so that your new friends can sign up for your list with one click.

Then, your new friends will be automatically entered into your DIA Headquarters into a group you've created just for them. This way, you'll be able to see who's signing up through your Myspace account and easily contact them later.

Here's how to do it:

1. Go to your DIA headquarters and create a new group for your Myspace signups. Be sure to copy the group key, a number found at the end of your URL when viewing your new group. It will look something like this:

So, in this case, you need to copy the 47223. We'll use it later.

2. Go to your Myspace account, and click " Edit profile"
Paste the code below into your " About me" section. Be sure to change all the placeholders with your org key, your Myspace URL, and your group key.

Read more (210 comments)

E-xemplar Series (Shameless Self-Promotion Class): Wal-Mart Movie

We promised an example of someone making great use of DemocracyInAction's coding flexibility. This isn't only that. Brave New Films' web site for its flick Wal-Mart: The High Cost of a Low Price is as tightly designed a site as you'd ever want to see. And their villainous take on the Wal-Mart smiley might have you waking up in a sweat at night.

For their house party event, they're using our API to pass data from their own pages. This is something you've gotta do on your own -- it's not for everyone, but it's brilliant if you can program it.

Read more