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

45
www.salsalabs.com

Upload: salsa-labs

Post on 10-May-2015

1.399 views

Category:

Technology


1 download

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

Page 1: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 2: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Where Customization Begins!

An Intro to the Salsa API and SalsaScript

Page 3: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Yon and Silona Silona and Yon

Yon - senior programmer - [email protected] - developer community manager - [email protected]

Page 4: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

1. Form Actions2. RESTful API

3. SalsaScript based API

SalsaAPI basics

Page 5: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

easy peasy

Form Based Actions

Page 6: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

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

Page 7: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Simple Signup Box for emailGather more infoPetitionsSurveysActionsEvent

You can get setup in minutes!

Page 8: Where Customization Begins: An Intro to the Salsa API and Salsascript

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

Page 9: Where Customization Begins: An Intro to the Salsa API and Salsascript

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

Page 10: Where Customization Begins: An Intro to the Salsa API and Salsascript

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

Page 11: Where Customization Begins: An Intro to the Salsa API and Salsascript

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

Page 12: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

TA DA!

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

Page 13: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

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

Page 14: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Petitions Surveys Email lists Events Actions

in minutes!

You can create

Page 16: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

RESTful API

Page 17: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

What is REST?

representational state transfer

Page 18: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

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

Page 19: Where Customization Begins: An Intro to the Salsa API and Salsascript

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

Page 20: Where Customization Begins: An Intro to the Salsa API and Salsascript

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?

Page 22: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 24: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 25: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 27: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 29: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 31: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 32: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 33: Where Customization Begins: An Intro to the Salsa API and Salsascript

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

Page 35: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

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

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

Additional resources

Page 36: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 37: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 39: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Power API -- using SalsaScript

Page 41: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 42: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Page 43: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

Eat your own dog food.

EYDF

Page 44: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

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

TA DA!

UniqueBeautifulall your own

Page 45: Where Customization Begins: An Intro to the Salsa API and Salsascript

www.salsalabs.com

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

Additional Resources