Documentation

/calendar/{contentId} [GET]

ThoughtFarmer REST API Method: /calendar/{contentId} [GET]

NOTE This API is only available in ThoughtFarmer 8.5.0.38 and after.

Retrieve calendar events by the calendar's content id.

URL:
http://yourserver.com/api/calendar{contentId}

Response Formats:
JSON

HTTP Method(s):
GET

Requires Authentication:
False - a token is not needed when calling this API endpoint

Parameters:

Parameter Type Description
contentId int Required 
  • The contentId of the calendar
startIndex int Optional
  • If startIndex = x, then, exclude the first x events from the list of events being returned
  • If no startIndex is supplied, then all events within the startDate and endDate are returned (as long as they are within the pageSize limit)
pageSize int Optional
  • This value determines how many events are returned that are within the startDate and endDate
  • To return all events between the startDate and endDate, supply a large number to pageSize (e.g. 1000)
  • If no pageSize is supplied, the default is to return 10 events
startDate string
  • can be iso8601 date string (e.g.  09-11T00:00:00:-7:00 )
  • or can be a string in the format of 'YYYY-MM-DD'
Optional
  • Events that are on or after this startDate are returned
  • If no startDate is supplied, the default startDate is today's date
endDate string
  • can be iso8601 date string (e.g.  2018-09-11T00:00:00Z )
  • or can be a string in the format of 'YYYY-MM-DD'
Optional
  • Events that are on or before this endDate are returned
  • If no endDate is supplied, the default endDate is the startDate + 30 days
Response Status Codes:
200 - Success
404 - Calendar page not found
400 - Bad request (client request to the server contains an error/is incorrect)

Example Requests:
GET (with optional parameters):
GET (without parameters):

Example Response:
{
    "events": [
        {
            "contentId": 809,
            "title": "Share an Umbrella with a Stranger Day",
            "startDate": {
                "iso8601": "2017-10-05T00:00:00Z",
                "ticks": 636427584000000000,
                "local": "2017-10-04T17:00:00"
            },
            "endDate": {
                "iso8601": "2017-10-05T00:00:00Z",
                "ticks": 636427584000000000,
                "local": "2017-10-04T17:00:00"
            },
            "isAllDay": true,
            "eventTypeId": 16,
            "isRepeating": false,
            "isMultiDay": false
        },
        {
            "contentId": 812,
            "title": "Beach Day",
            "startDate": {
                "iso8601": "2017-10-09T00:00:00Z",
                "ticks": 636431040000000000,
                "local": "2017-10-08T17:00:00"
            },
            "endDate": {
                "iso8601": "2017-10-09T00:00:00Z",
                "ticks": 636431040000000000,
                "local": "2017-10-08T17:00:00"
            },
            "isAllDay": true,
            "eventTypeId": 5,
            "isRepeating": false,
            "isMultiDay": false
        },
        {
            "contentId": 810,
            "title": "Free Ice Cream Day",
            "startDate": {
                "iso8601": "2017-10-17T00:00:00Z",
                "ticks": 636437952000000000,
                "local": "2017-10-16T17:00:00"
            },
            "endDate": {
                "iso8601": "2017-10-17T00:00:00Z",
                "ticks": 636437952000000000,
                "local": "2017-10-16T17:00:00"
            },
            "isAllDay": true,
            "eventTypeId": 2,
            "isRepeating": false,
            "isMultiDay": false
        },
        {
            "contentId": 811,
            "title": "10 Cents Bake Sale",
            "startDate": {
                "iso8601": "2017-10-20T00:00:00Z",
                "ticks": 636440544000000000,
                "local": "2017-10-19T17:00:00"
            },
            "endDate": {
                "iso8601": "2017-10-20T00:00:00Z",
                "ticks": 636440544000000000,
                "local": "2017-10-19T17:00:00"
            },
            "isAllDay": true,
            "eventTypeId": 1,
            "isRepeating": false,
            "isMultiDay": false
        }
    ],
    "totalEvents": 4,
    "eventTypes": [
        {
            "color": "#DBA27D",
            "eventTypeId": 1,
            "className": "fa-calendar",
            "default": true,
            "active": true,
            "label": [
                {
                    "key": "de",
                    "value": "Ereignis"
                },
                {
                    "key": "en",
                    "value": "Event"
                },
                {
                    "key": "es",
                    "value": "Evento"
                },
                {
                    "key": "fr",
                    "value": "Évènement"
                },
                {
                    "key": "it",
                    "value": "Evento"
                },
                {
                    "key": "ja",
                    "value": ""
                },
                {
                    "key": "ko",
                    "value": ""
                },
                {
                    "key": "nl",
                    "value": "Gebeurtenis"
                },
                {
                    "key": "pt",
                    "value": "Evento"
                },
                {
                    "key": "ru",
                    "value": ""
                },
                {
                    "key": "tr",
                    "value": "Olay"
                },
                {
                    "key": "zh-CN",
                    "value": ""
                }
            ]
        },
        {
            "color": "#91D0EA",
            "eventTypeId": 2,
            "className": "fa-users",
            "default": true,
            "active": true,
            "label": [
                {
                    "key": "de",
                    "value": "Sitzung"
                },
                {
                    "key": "en",
                    "value": "Meeting"
                },
                {
                    "key": "es",
                    "value": "Reunión"
                },
                {
                    "key": "fr",
                    "value": "Réunion"
                },
                {
                    "key": "it",
                    "value": "Riunione"
                },
                {
                    "key": "ja",
                    "value": ""
                },
                {
                    "key": "ko",
                    "value": ""
                },
                {
                    "key": "nl",
                    "value": "Vergadering"
                },
                {
                    "key": "pt",
                    "value": "Reunião"
                },
                {
                    "key": "ru",
                    "value": ""
                },
                {
                    "key": "tr",
                    "value": "Toplant"
                },
                {
                    "key": "zh-CN",
                    "value": ""
                }
            ]
        },
        {
            "color": "#E9BDF9",
            "eventTypeId": 5,
            "className": "fa-smile-o",
            "default": true,
            "active": true,
            "label": [
                {
                    "key": "de",
                    "value": "Urlaub"
                },
                {
                    "key": "en",
                    "value": "Vacation"
                },
                {
                    "key": "es",
                    "value": "Vacaciones"
                },
                {
                    "key": "fr",
                    "value": "Vacances"
                },
                {
                    "key": "it",
                    "value": "Vacanza"
                },
                {
                    "key": "ja",
                    "value": ""
                },
                {
                    "key": "ko",
                    "value": ""
                },
                {
                    "key": "nl",
                    "value": "Vakantie"
                },
                {
                    "key": "pt",
                    "value": "Férias"
                },
                {
                    "key": "ru",
                    "value": ""
                },
                {
                    "key": "tr",
                    "value": "Tatil"
                },
                {
                    "key": "zh-CN",
                    "value": ""
                }
            ]
        },
        {
            "color": "#00d9ff",
            "eventTypeId": 16,
            "className": "fa-umbrella",
            "default": true,
            "active": true,
            "label": [
                {
                    "key": "en",
                    "value": "Share an Umbrella with a Stranger Day"
                }
            ]
        }
    ],
    "body": [
        {
            "key": "en",
            "value": ""
        }
    ],
    "contentId": 808,
    "title": [
        {
            "key": "en",
            "value": "My Calendar"
        }
    ],
    "abbreviatedTitle": [
        {
            "key": "en",
            "value": ""
        }
    ],
    "summary": [
        {
            "key": "en",
            "value": ""
        }
    ],
    "dateModified": "2017-10-02T18:18:29.443",
    "datePosted": "2017-10-02T18:18:03.677",
    "datePublished": "2017-10-02T18:18:03.677",
    "modifiedId": 1,
    "creatorId": 1,
    "ownerId": 1,
    "parentId": 769,
    "grandParentId": 0,
    "treePath": "<a href=\"http://summit.openroad.local:81/\">Home</a>  <a href=\"http://summit.openroad.local:81/people/\">People</a>  <a href=\"http://summit.openroad.local:81/content/7/dr-admin-kathy\">Dr. Admin Kathy</a>  <a href=\"http://summit.openroad.local:81/content/769/calendars\">Calendars</a>  <a href=\"http://summit.openroad.local:81/content/808/my-calendar\" id=\"pageTitle\">My Calendar</a>",
    "treePathText": "Home &rsaquo; People &rsaquo; Dr. Admin Kathy &rsaquo; Calendars &rsaquo; My Calendar",
    "lastModifiedBy": "Updated <abbr class=\"timeago\" title=\"2017-10-02T18:18:29Z\">2 hr</abbr> by <a href=\"http://summit.openroad.local:81/content/7\" title=\"Dr. Admin Kathy\">Dr. Admin Kathy</a>",
    "permissionIsEdit": true,
    "permissionIsView": true,
    "isPublished": true,
    "allowFiles": false,
    "pageType": "Calendar"
}