Your SlideShare is downloading. ×
0
www.salsalabs.com
Where Customization Begins!   An Intro to the Salsa API and             SalsaScript                                   www....
Yon and SilonaSilona and YonYon - senior programmer - yharegot@salsalabs.comSilona - developer community manager - silona@...
SalsaAPI basics    1. Form Actions    2. RESTful API3. SalsaScript based API                           www.salsalabs.com
Form Based Actions   easy peasy                     www.salsalabs.com
https://secure.flickr.com/photos/doolloop/110837794/                                           www.salsalabs.com
You can get setup in minutes!Simple Signup Box for emailGather more infoPetitionsSurveysActionsEvent                      ...
Step 1Create the Page in Salsa HQAdd various options you will need -- addsupporter to a group, send email trigger(s)upon s...
Step 2Cut and Paste!Click on the link generated in HQ to view the page, then cut & paste relevant section (everything betw...
Step 3Fix the relative pathChange the relative path in the form action to an absolute path pointing to your node location<...
Step 4Set up Error messagesadd the following anywhere on you page.<script type="text/javascript" src="http://yournode/api/...
TA DA!                                                  www.salsalabs.com    https://secure.flickr.com/photos/cc_chapman/4...
What is a NPO without Supporters?and ways to encourage them to sign upmore?                                        www.sal...
You can createPetitionsSurveysEmail listsEventsActions                 in minutes!                      www.salsalabs.com
Additional resources●   http://www.salsalabs.com/devs●   http://www.salsalabs.    com/devs/recipes/webform_api/signup_for ...
RESTful API              www.salsalabs.com
What is REST?representational state transfer                                  www.salsalabs.com
https://secure.flickr.com/photos/becca/9541595/                                              www.salsalabs.com
No Really... What is REST            http://tomayko.com/writings/rest-to-my-wife                  Get Put Delete an object...
Why REST?MongoDB - NoSQL● Integrations  ●   Mashery      ●   150K dev          ●   easy dev - check box like salesforce   ...
Primary use cases are for syncing dataacross desparate databases.Authentication● http://hq-salsa.democracyinaction.  org/a...
www.salsalabs.com
getObject.sjsGetting data:-- xmlhttp://hq-salsa.democracyinaction.org/api/getObject.sjs?xml&object=supporter&key=thesuppor...
www.salsalabs.com
www.salsalabs.com
getObjects.sjshttp://hq-salsa.democracyinaction.org/api/getObjects.sjs?xml&object=supporter&include=First_Name,Last_Name,E...
www.salsalabs.com
getLeftJoin.sjs●   http://hq-salsa.democracyinaction.    org/api/getLeftJoin.sjs?    xml&object=supporter_groups,    suppo...
www.salsalabs.com
getCounts.sjs●   http://hq-salsa.democracyinaction.    org/api/getCounts.sjs?    object=donation&condition=RESULT=0&c    o...
www.salsalabs.com
www.salsalabs.com
/saveAdding datahttps://hq-salsa.democracyinaction.org/save?xml&object=supporter&organization_KEY=yourorgKEY&key=thesuppor...
/save continuedcreating a completely new supporterhttps://hq-salsa.democracyinaction.org/save?xml&object=supporter&organiz...
Additional resources●   http://www.salsalabs.    com/devs/recipes/data_api/synchronize●   http://www.salsalabs.    com/dev...
www.salsalabs.com
www.salsalabs.com
Participate!https://docs.google.com/spreadsheet/ccc? key=0AmFGN9Kd_fgSdEpXV0FCYWlHSi 16ZVMtNGJwLTlnUnc#gid=0sign up to hel...
Power API -- using SalsaScript                                 www.salsalabs.com
Beautiful Examplehttps://secure.engenderhealth.org/o/1222/p/d/engenderhealth/donations/public/secure-donation-v3-x2.sjs   ...
www.salsalabs.com
www.salsalabs.com
EYDFEat your own dog food.                         www.salsalabs.com
TA DA!UniqueBeautifulall your own     https://secure.flickr.     com/photos/288639     39@N04/54195975     17/           w...
Additional Resourceshttp://www.salsalabs. com/devs/developer_signup                             www.salsalabs.com
Upcoming SlideShare
Loading in...5
×

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

1,429

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.

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

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

No notes for slide

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

  1. 1. www.salsalabs.com
  2. 2. Where Customization Begins! An Intro to the Salsa API and SalsaScript www.salsalabs.com
  3. 3. Yon and SilonaSilona and YonYon - senior programmer - yharegot@salsalabs.comSilona - developer community manager - silona@salsalabs.com www.salsalabs.com
  4. 4. SalsaAPI basics 1. Form Actions 2. RESTful API3. SalsaScript based API www.salsalabs.com
  5. 5. Form Based Actions easy peasy www.salsalabs.com
  6. 6. https://secure.flickr.com/photos/doolloop/110837794/ www.salsalabs.com
  7. 7. You can get setup in minutes!Simple Signup Box for emailGather more infoPetitionsSurveysActionsEvent www.salsalabs.com
  8. 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. 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. 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. 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. 12. TA DA! www.salsalabs.com https://secure.flickr.com/photos/cc_chapman/4878364959/
  13. 13. What is a NPO without Supporters?and ways to encourage them to sign upmore? www.salsalabs.com
  14. 14. You can createPetitionsSurveysEmail listsEventsActions in minutes! www.salsalabs.com
  15. 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. 16. RESTful API www.salsalabs.com
  17. 17. What is REST?representational state transfer www.salsalabs.com
  18. 18. https://secure.flickr.com/photos/becca/9541595/ www.salsalabs.com
  19. 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. 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. 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. 22. www.salsalabs.com
  23. 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. 24. www.salsalabs.com
  25. 25. www.salsalabs.com
  26. 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. 27. www.salsalabs.com
  28. 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. 29. www.salsalabs.com
  30. 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. 31. www.salsalabs.com
  32. 32. www.salsalabs.com
  33. 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. 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. 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. 36. www.salsalabs.com
  37. 37. www.salsalabs.com
  38. 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. 39. Power API -- using SalsaScript www.salsalabs.com
  40. 40. Beautiful Examplehttps://secure.engenderhealth.org/o/1222/p/d/engenderhealth/donations/public/secure-donation-v3-x2.sjs www.salsalabs.com
  41. 41. www.salsalabs.com
  42. 42. www.salsalabs.com
  43. 43. EYDFEat your own dog food. www.salsalabs.com
  44. 44. TA DA!UniqueBeautifulall your own https://secure.flickr. com/photos/288639 39@N04/54195975 17/ www.salsalabs.com
  45. 45. Additional Resourceshttp://www.salsalabs. com/devs/developer_signup www.salsalabs.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×