where customization begins: an intro to the salsa api and salsascript

Post on 10-May-2015

1.399 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Where Customization Begins: An Intro to the Salsa API and Salsascript -- presentation by Salsa's Silona and Yonathan for the 2011 Salsa Community Conference.

TRANSCRIPT

www.salsalabs.com

www.salsalabs.com

Where Customization Begins!

An Intro to the Salsa API and SalsaScript

www.salsalabs.com

Yon and Silona Silona and Yon

Yon - senior programmer - yharegot@salsalabs.comSilona - developer community manager - silona@salsalabs.com

www.salsalabs.com

1. Form Actions2. RESTful API

3. SalsaScript based API

SalsaAPI basics

www.salsalabs.com

easy peasy

Form Based Actions

www.salsalabs.com

https://secure.flickr.com/photos/doolloop/110837794/

www.salsalabs.com

Simple Signup Box for emailGather more infoPetitionsSurveysActionsEvent

You can get setup in minutes!

www.salsalabs.com

Create the Page in Salsa HQ Add various options you will need -- add supporter to a group, send email trigger(s) upon sign-up, redirect info, etc.

Step 1

www.salsalabs.com

Cut and Paste! Click on the link generated in HQ to view the

page, then cut & paste relevant section (everything between <form> ... </form>) to your hosted site.

Step 2

www.salsalabs.com

Fix the relative path Change the relative path in the form action

to an absolute path pointing to your node location

<form name="data" action="/save" method="POST">to<form name="data" action="http://hq-salsa.

democracyinaction.org/save" method="POST">

Step 3

www.salsalabs.com

Set up Error messages add the following anywhere on you page.<script type="text/javascript" src="http://yournode/api/flashMessageJS.sjs"></script>e.g.<script type="text/javascript" src="http://hq-salsa.democracyinaction.org/api/flashMessageJS.sjs"></script>

Step 4

www.salsalabs.com

TA DA!

https://secure.flickr.com/photos/cc_chapman/4878364959/

www.salsalabs.com

What is a NPO without Supporters? and ways to encourage them to sign up more?

www.salsalabs.com

Petitions Surveys Email lists Events Actions

in minutes!

You can create

www.salsalabs.com

RESTful API

www.salsalabs.com

What is REST?

representational state transfer

www.salsalabs.com

https://secure.flickr.com/photos/becca/9541595/

www.salsalabs.com

http://tomayko.com/writings/rest-to-my-wife

Get Put Delete an objectCRUD Create, Read, Update and Delete

● Current API - getObject or getObjects

○ Powerful but obtuse

● RESTful API - more specific○ getSupporter○ getEvent○ getDonation

No Really... What is REST

www.salsalabs.com

MongoDB - NoSQL● Integrations

● Mashery ● 150K dev

● easy dev - check box like salesforce● hire more devs but for free

● Drupal ● Large scale CMS

● Wordpress ● 22% of the websites

Why REST?

www.salsalabs.com

www.salsalabs.com

www.salsalabs.com

www.salsalabs.com

www.salsalabs.com

www.salsalabs.com

www.salsalabs.com

www.salsalabs.com

Adding datahttps://hq-salsa.democracyinaction.org/save?xml&object=supporter&organization_KEY=yourorgKEY&key=thesupporter_KEY&City=myCity&First_Name=Yoncheck:http://hq-salsa.democracyinaction.org/api/getObjects.sjs?xml&object=supporter&include=First_Name,Last_Name,Email&condition=supporter_KEY=thesupporter_KEY

/save

www.salsalabs.com

● http://www.salsalabs.com/devs/recipes/data_api/synchronize

● http://www.salsalabs.com/devs/recipes/data_api/event_signups

Additional resources

www.salsalabs.com

www.salsalabs.com

www.salsalabs.com

Power API -- using SalsaScript

www.salsalabs.com

www.salsalabs.com

www.salsalabs.com

Eat your own dog food.

EYDF

www.salsalabs.com

https://secure.flickr.com/photos/28863939@N04/5419597517/

TA DA!

UniqueBeautifulall your own

www.salsalabs.com

http://www.salsalabs.com/devs/developer_signup

Additional Resources

top related