Your SlideShare is downloading. ×
0
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Where Customization Begins: An Intro to the Salsa API and Salsascript
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

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

1,424

Published on

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

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

Published in: Technology, Design
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,424
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. www.salsalabs.com
  • 2. Where Customization Begins! An Intro to the Salsa API and SalsaScript www.salsalabs.com
  • 3. Yon and SilonaSilona and YonYon - senior programmer - yharegot@salsalabs.comSilona - developer community manager - silona@salsalabs.com www.salsalabs.com
  • 4. SalsaAPI basics 1. Form Actions 2. RESTful API3. SalsaScript based API www.salsalabs.com
  • 5. Form Based Actions easy peasy www.salsalabs.com
  • 6. https://secure.flickr.com/photos/doolloop/110837794/ www.salsalabs.com
  • 7. You can get setup in minutes!Simple Signup Box for emailGather more infoPetitionsSurveysActionsEvent www.salsalabs.com
  • 8. Step 1Create the Page in Salsa HQAdd various options you will need -- addsupporter to a group, send email trigger(s)upon sign-up, redirect info, etc. www.salsalabs.com
  • 9. Step 2Cut 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. www.salsalabs.com
  • 10. Step 3Fix the relative pathChange 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"> www.salsalabs.com
  • 11. Step 4Set up Error messagesadd 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> www.salsalabs.com
  • 12. TA DA! www.salsalabs.com https://secure.flickr.com/photos/cc_chapman/4878364959/
  • 13. What is a NPO without Supporters?and ways to encourage them to sign upmore? www.salsalabs.com
  • 14. You can createPetitionsSurveysEmail listsEventsActions in minutes! www.salsalabs.com
  • 15. Additional resources● http://www.salsalabs.com/devs● http://www.salsalabs. com/devs/recipes/webform_api/signup_for m● http://www.salsalabs. com/p/salsa/website/public2/commons/de v/docs/api/unauthenticated.sjs?null● http://www.salsalabs. com/devs/recipes/webform_api/action_for m● http://www.salsalabs. www.salsalabs.com
  • 16. RESTful API www.salsalabs.com
  • 17. What is REST?representational state transfer www.salsalabs.com
  • 18. https://secure.flickr.com/photos/becca/9541595/ www.salsalabs.com
  • 19. No Really... What is REST http://tomayko.com/writings/rest-to-my-wife Get Put Delete an object CRUD Create, Read, Update and Delete● Current API - getObject or getObjects ○ Powerful but obtuse● RESTful API - more specific ○ getSupporter ○ getEvent ○ getDonation www.salsalabs.com
  • 20. Why REST?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 www.salsalabs.com
  • 21. Primary use cases are for syncing dataacross desparate databases.Authentication● http://hq-salsa.democracyinaction. org/api/authenticate.sjs? email=youremailaddress&password=your password www.salsalabs.com
  • 22. www.salsalabs.com
  • 23. getObject.sjsGetting data:-- xmlhttp://hq-salsa.democracyinaction.org/api/getObject.sjs?xml&object=supporter&key=thesupporter_KEY -- jsonhttp://hq-salsa.democracyinaction.org/api/getObject.sjs?json&object=supporter&key=thesupporter_K www.salsalabs.comEY
  • 24. www.salsalabs.com
  • 25. www.salsalabs.com
  • 26. getObjects.sjshttp://hq-salsa.democracyinaction.org/api/getObjects.sjs?xml&object=supporter&include=First_Name,Last_Name,Email&condition=supporter_KEY=condition● Note how you can add an include parameter, you can toggle the out put by changing xml to json● Condition can be anything that you would put in the where part of a sql query www.salsalabs.com
  • 27. www.salsalabs.com
  • 28. getLeftJoin.sjs● http://hq-salsa.democracyinaction. org/api/getLeftJoin.sjs? xml&object=supporter_groups, supporter&condition=supporter_KEY=thes upporter_KEY&include=groups_KEY www.salsalabs.com
  • 29. www.salsalabs.com
  • 30. getCounts.sjs● http://hq-salsa.democracyinaction. org/api/getCounts.sjs? object=donation&condition=RESULT=0&c ountColumn=amount&xml&callback● http://hq-salsa.democracyinaction. org/api/getCounts.sjs? object=donation&condition=RESULT=0&c ountColumn=amount&json&callback www.salsalabs.com
  • 31. www.salsalabs.com
  • 32. www.salsalabs.com
  • 33. /saveAdding 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, www.salsalabs.com
  • 34. /save continuedcreating a completely new supporterhttps://hq-salsa.democracyinaction.org/save?xml&object=supporter&organization_KEY=yourorganization_KEY&key=0&City=myCity&First_Name=Tester&Email=newRestSupporter@testing.salsalabs.com www.salsalabs.com
  • 35. Additional resources● http://www.salsalabs. com/devs/recipes/data_api/synchronize● http://www.salsalabs. com/devs/recipes/data_api/event_signups www.salsalabs.com
  • 36. www.salsalabs.com
  • 37. www.salsalabs.com
  • 38. Participate!https://docs.google.com/spreadsheet/ccc? key=0AmFGN9Kd_fgSdEpXV0FCYWlHSi 16ZVMtNGJwLTlnUnc#gid=0sign up to help prioritizehelp us help you! www.salsalabs.com
  • 39. Power API -- using SalsaScript www.salsalabs.com
  • 40. Beautiful Examplehttps://secure.engenderhealth.org/o/1222/p/d/engenderhealth/donations/public/secure-donation-v3-x2.sjs www.salsalabs.com
  • 41. www.salsalabs.com
  • 42. www.salsalabs.com
  • 43. EYDFEat your own dog food. www.salsalabs.com
  • 44. TA DA!UniqueBeautifulall your own https://secure.flickr. com/photos/288639 39@N04/54195975 17/ www.salsalabs.com
  • 45. Additional Resourceshttp://www.salsalabs. com/devs/developer_signup www.salsalabs.com

×