Spongecell API Documentation: Reference - Events
Events
Lets you view public events as well as events that the currently authenticated user is entitled to view. Also provides search functionality for events across multiple calendars.
For the index action, various combinations of parameters can be specified to perform searches on events. A single calendar, or a set of multiple calendars to search against can be specified with the calendar_id or calendar_ids parameters. If none are specified, all of the currently authorized user's calendars will be used as the default.
Multiple ids can also be specified with the ids parameter and those specific events will be returned. This parameter can also be used on the update and destroy actions.
In addition to specifying the calendars, either the text parameter can be specified to do a wild-card search of the parameter value across all text fields of events, or a specific field and value can be specified to search across those fields. In the former case, the search is a UNION (OR), while in the latter, it is an intersection (AND).
When looking up a specific event through the show action, you can also specify whether to show the comments as well. Passing comments=true will return a default (limited) set of the comments, but you can also pass nested parameters like comments[limit]=5&comments[offset]=5 to return specific sets of comments. See the comments resource for more.
Examples
Please log in (above) to see more examples.
Show a new event (which shows the fields that can be passed in the create): /api/events/new.
List all the events on the sample calendar: /api/events?calendar_id=62739.
Show up to 20 events after a specified time: /api/events?calendar_id=62739&start_time=200705111700.
Actions
The following actions are supported for this resource:
| index | GET | /api/events | Returns events matching specified criteria. |
| ids | STRING | Multiple resource ids (comma delimited) | |
| calendar_id | INTEGER | The id of the calendar | |
| calendar_ids | INTEGER | The ids of the calendars (comma delimited) | |
| limit | INTEGER | The maximum number of results to return. | |
| offset | INTEGER | Used in conjunction with limit, the offset to return results from | |
| start_time | DATETIME | The start time of the event | |
| end_time | DATETIME | The end time of the event | |
| text | STRING | Text to search on (across multiple fields) | |
| description | STRING | Description | |
| state | STRING | The state of the event location | |
| tags | STRING | Tag text to search on | |
| country | STRING | The country of the event location | |
| title | STRING | Title | |
| city | STRING | The city of the event location | |
| location_name | STRING | The name of the location of the event | |
| zip | STRING | The zip of the event location | |
| street | STRING | The street address of the event location | |
| location | STRING | The location of the event | |
| show | GET | /api/events/1 | Return an expanded set of fields for the specified resource. |
| comments | STRING | Specifies whether the comments should be included. Nested parameters can be specified (see comments resource) | |
| new | GET | /api/events/new | Construct a new resource (do NOT save it), returning the editable fields with default values. |
| edit | GET | /api/events/1/edit | Return the editable fields for the specified resource. |
| create | POST | /api/events | Create a new resource from the data in the POST request. |
| title | STRING | Title | |
| description | STRING | Description | |
| start_time | DATETIME | The start time of the event | |
| end_time | DATETIME | The end time of the event | |
| location | STRING | The location of the event | |
| image_url | STRING | An url pointing to an image | |
| tag_list | STRING | A list of tags (will overwrite for update) | |
| update | PUT | /api/events/1 | Update the specified resource with the data in the POST request. |
| ids | STRING | Multiple resource ids (comma delimited) | |
| title | STRING | Title | |
| description | STRING | Description | |
| start_time | DATETIME | The start time of the event | |
| end_time | DATETIME | The end time of the event | |
| location | STRING | The location of the event | |
| image_url | STRING | An url pointing to an image | |
| tag_list | STRING | A list of tags (will overwrite for update) | |
| tag | STRING | A single tag (will append to existing tag list during update) | |
| destroy | DELETE | /api/events/1 | Delete the specified resource. |
| ids | STRING | Multiple resource ids (comma delimited) | |
| add | PUT | /api/events/1/add | Add the specified event to the specified calendar, or authenticated user's primary calendar. |
| calendar_id | INTEGER | The id of the calendar | |
| remove | PUT | /api/events/1/remove | Remove the specified event from the specified calendar, or authenticated user's primary calendar. |
| calendar_id | INTEGER | The id of the calendar | |
| repeat | PUT | /api/events/1/repeat | Repeats the specified event. |
| frequency | STRING | The frequency to repeat: DAILY, WEEKLY, MONTHLY, YEARLY | |
| interval | STRING | The interval of the repetition | |
| start_date | DATETIME | The start of the repetition | |
| end_date | DATETIME | The end of the repetition | |
| copy | PUT | /api/events/1/copy | Copy the specified event to the specified calendar, or authenticated user's primary calendar. |
| calendar_id | INTEGER | The id of the calendar | |
| send_to_me | PUT | /api/events/1/send_to_me | Sends event information to the specified email address or mobile number. |
| STRING | Email address | ||
| mobile_number | STRING | Mobile phone number | |
| opt_in | BOOLEAN | Whether to opt the email or sms address in to the list | |
