|
Salsa APIHere are some quick, commonly used examples of the Salsa API to retrieve and save data for various different tasks. EventsYou can use our Salsa API to get Events from our database, customizing the conditions, and the fields returned.Retrieve all your events http://sample.nodeurl.tld/api/getObjects.sjs?xml&object=event&condition=Status=Active You can refine your query to return only the columns you want by adding a include clause. http://sample.nodeurl.tld/api/getObjects.sjs?xml&object=event&condition=Start%3C2009-06-22&include=Ticket_Price,Event_Name Retrieve all your events before a date. In this case events that have a start date before 2008-05-27 http://sample.nodeurl.tld/api/getObjects.sjs?object=event&condition=Start%3C=2008-05-27,Status=Active Sample output
<?xml version="1.0"?>
<data organization_KEY="0">
<event>
<item>
<Ticket_Price>25.00</Ticket_Price>
<length>5</length>
<event_KEY>1</event_KEY>
<key>1</key>
<object>event</object>
<Event_Name>my event</Event_Name>
</item>
<item>
<Ticket_Price>0.00</Ticket_Price>
<length>5</length>
<event_KEY>2</event_KEY>
<key>2</key>
<object>event</object>
<Event_Name>my other event</Event_Name>
</item>
<item>
<Ticket_Price>0.00</Ticket_Price>
<length>5</length>
<event_KEY>9</event_KEY>
<key>9</key>
<object>event</object>
<Event_Name>test</Event_Name>
</item>
<item>
<Ticket_Price/>
<length>5</length>
<event_KEY>16</event_KEY>
<key>16</key>
<object>event</object>
<Event_Name>test dia</Event_Name>
</item>
<item>
<Ticket_Price/>
<length>5</length>
<event_KEY>17</event_KEY>
<key>17</key>
<object>event</object>
<Event_Name>MySalsa Event</Event_Name>
</item>
<item>
<Ticket_Price/>
<length>5</length>
<event_KEY>18</event_KEY>
<key>18</key>
<object>event</object>
<Event_Name>MySalsa Event</Event_Name>
</item>
.
.
.
<count>35</count>
</event>
</data>
Retrieve all your events on a specfic date. In this case events that are scheduled to start on 2008-05-27 http://sample.nodeurl.tld/api/getObjects.sjs?object=event&condition=Start=2008-05-27,Status=Active SavingYou can also save events using the API http://sample.nodeurl.tld/save?object=event&Event_Name=Community Organizing&Start=2008-05-27&End=2008-06-10 To sign up supporters to an event http://sample.nodeurl.tld/save?xml&object=supporter_event&supporter_KEY=2373&event_KEY=3 Distributed EventsRetrieve all your events on a specfic date. In this case events that are scheduled to start on 2008-05-27 http://sample.nodeurl.tld/api/getObjects.sjs?object=distributed_event&condition=Start=2008-05-27 SupportersYou can use our Salsa API to get supporters from our databaseTo get a list of all your supporters http://sample.nodeurl.tld/api/getObjects.sjs?xml&object=supporter&include=First_Name,Last_Name,Email To get the inforamation on one supporter. Note the call to getObject and not getObjects. http://sample.nodeurl.tld/api/getObject.sjs?xml&object=supporter&key=123 Savinghttp://sample.nodeurl.tld/save?xml&object=supporter&Email=mytestemail@test.com&First_Name=John&Last_Name=Doe&Phone=703-555-5555 DonorsYou can use our Salsa API to get donations from our database http://sample.nodeurl.tld/api/getObjects.sjs?xml&object=donation SavingTo save a donation http://sample.nodeurl.tld/save?xml&object=donation&supporter_KEY=2373&amount=15.35&Transaction_Date=2008-08-03&Transaction_Type=Donation Peer-to-peer fundraising pageshttp://sample.nodeurl.tld/api/getObjects.sjs?xml&object=supporter_my_donate_page |