JSON is an acronym for Javascript Object Notation. It's a format for exchanging data with Javascript code. Additionally most programming languages have libraries that can parse JSON data. Compared to processing RSS/XML, JSON has less overhead and it's easier to use.
The URL to access data in JSON format from Connect Daily is:
[/calendar path]/jsonp/by method/(object id | list).js[?URLOption=value[&URLOption...=value]]
if the requested file name is "list.js", then a list of items of (by method) will be returned. E.G. a list of calendars. Otherwise, a list of events matching (by_method)/(object id) are returned.
By Method Value |
Description |
calendar_id |
The ID of the calendar to extract events for. (object id) is the calendar ID. |
cal_item_id |
The cal_item_id of a specific event to retrieve data for. |
item_type_id |
The event type id to extract events for. |
resource_id |
Resource ID to extract events for. |
resource_type_id |
Resource Type ID to extract events for. |
Parameter Name |
Description |
allow_duplicates |
The default behavior is to export each event only one time, no matter how many times the event occurs during the dayspan. If you want every occurrence of an event to be exported, add allow_duplicates=1 as an argument. |
callback |
Callback function to send data to. If you're using jQuery, the format for the callback function would be ?callback=? |
dayspan |
# of days to retrieve events for. If not specified, uses the Default # of Days to Export value from System | Configuration | Sync/Export Options. |
integral_days |
Default 1. Say you set maxcount=12 and the 13th event is on the same day as the 12th event. If integral_days=1 (the default), then all events that happen on the same day as the item specified by maxcount are included. To disable this, pass integral_days=0 as an argument. |
maxcount |
Maximum number of events to return. If not specified, uses the Default Max Events to Export value from System | Configuration | Sync/Export Options. The number of returned elements is also impacted by integral_days. |
reverse |
If reverse=1, reverse the default order of the returned events. maxcount is applied before the reverse operation is performed. |
rollup |
0 - Don't roll up events from included calendars into this export. 1 - Default. Follow the option set at the calendar level for rollup. |
show_resources |
If show_resources=1 then resource names assigned to the event will be suffixed to the event title. If this value is not specified, the user level preference will be used. Regardless of this setting, resources are exported on the event as an array of resource objects. |
start |
Start Date in Julian day number format. |
startdate enddate |
Dates for start and end of exported data. This should be either in yyyy-mm-dd format, or the correct format for the request's first accept-language. |
username password |
If you want to use the export from another program, and the export requires a login to be visible, you can pass the user name and password as arguments. See the example below. |
Retrieve a list of calendar the user can view:
http://calendar.yourdomain.com/jsonp/calendar_id/list.js
Retrieve the next 7 days of events from a specific calendar.
http://calendar.yourdomain.com/jsonp/calendar_id/3.js?dayspan=7
Retrieve a maximum of 12 events for a specific resource and send it to a Javascript function named MyCallbackFunction:
http://calendar.yourdomain.com/jsonp/resource_id/3.js?callback=MyCallbackFunction&maxcount=12
See Also: Filtering on Multiple Options