Dynamic includes

On most resources, you can dynamically include related objects (aka. expand objects). E.g. for a resource you can include the resource's calendars in the response by adding ?include=calendars to the URL.

You may also supply multiple objects that you want to fetch by separating them with commas, e.g. ?include=calendars,accounts

Available includes will be listed under each endpoint.

Example request with included calendar:

curl --request GET \
  --url https://api.timekit.io/v2/resources/78a4d873-2a68-41c6-bdd4-c0ca5b35efd3?include=calendars \
  --header 'Content-Type: application/json' \
  --user :live_api_key_7nzvc7wsBQQISLeFSVhROys9V1bUJ1z7

Example response

{
    "data": {
        "activated": true,
        "calendars": [
            {
                "id": "fef0da1b-80d4-46f8-8d38-4457aad38fc1",
                "backgroundcolor": "#FFFFFF",
                "description": "Doc. Browns bookings",
                "foregroundcolor": "#000000",
                "name": "Bookings",
                "system": false
            }
        ],
        "email": "[email protected]",
        "first_name": "Dr. Emmett",
        "img": "http://www.gravatar.com/avatar/7a613e5348d63476276935025",
        "last_name": "Brown",
        "last_sync": null,
        "name": "Dr. Emmett Brown",
        "timezone": "America/Los_Angeles",
        "token": "UZpl3v3PTP1PRwqIrU0DSVpbJkNKl5gN"
    }
}

You can include data in nested layers, so if you include calendars then you can also include events (since events are nested under calendars). You can achieve that by using the dot annotation, so ?include=calendars.events, will return your calendars including their events.

Example request:

curl --request GET \
  --url https://api.timekit.io/v2/resources/78a4d873-2a68-41c6-bdd4-c0ca5b35efd3?include=calendars.events \
  --header 'Content-Type: application/json' \
	--user :live_api_key_7nzvc7wsBQQISLeFSVhROys9V1bUJ1z7

Will return:

{
    "data": {
        "activated": true,
        "calendars": [
            {
              	"id": "fef0da1b-80d4-46f8-8d38-4457aad38fc1",
                "backgroundcolor": "#FFFFFF",
                "description": "Doc. Browns bookings",
                "events": [
                    {
                      "id": "892d7425-ea2d-4d7d-a74e-e69fad7813cc",
                      "what": "Update",
                      "where": "Skype",
                      "rsvp": "needsAction",
                      "allDay": false,
                      "start": "2014-10-14T14:30:00+00:00",
                      "end": "2014-10-14T15:30:00+00:00",
                      "description": "Update about the FluxCapacitator"
                    },
                    {
                      "id": "4b08a047-3133-41f1-83e1-27cb933d8dbb",
                      "what": "Strategy Meeting",
                      "where": "1355 Market st, San Francisco, CA",
                      "rsvp": "accepted",
                      "allDay": false,
                      "start": "2014-10-14T10:00:00+00:00",
                      "end": "2014-10-14T12:00:00+00:00",
                      "description": "How to make a timemachine"
                    },
                ],
                "foregroundcolor": "#000000",
                "name": "Bookings",
                "system": false
            }
        ],
        "email": "[email protected]",
        "first_name": "Dr. Emmett",
        "img": "http://www.gravatar.com/avatar/7a613e5348d63476276935025",
        "last_name": "Brown",
        "last_sync": null,
        "name": "Dr. Emmett Brown",
        "timezone": "America/Los_Angeles",
        "token": "UZpl3v3PTP1PRwqIrU0DSVpbJkNKl5gN"
    }
}