Google Calendar

The easiest way to convert your google calendar into a REST API.

Overview

With Google Calendar, you can quickly schedule meetings and events and get reminders about upcoming activities, so you always know what’s next.

Getting Started

After you create an account and log in to the dashboard, choose Google Calendar on the collections page. To make Google Calendar API you have to Authenticate your Google Calendar Account by click on the "Authenticate Account" at the top of the Google Calendar form.

After authenticating you will be redirected back to the SlashApi with a Google Calendar Form. In this form, you just need to provide a name for your API, click on the Submit button and your Google Calendar API is ready.

API Endpoints

Get Calendar Lists

Returns the calendars on your calendar list.

GET
<team>/google-calendar/<identifier>

Example

var axios = require('axios');

var config = {
    method: 'get',
    url: 'https://v1.slashapi.com/slashapi/google-calendar/ax2Q0ZzBni'
};

axios(config)
    .then(function (response) {
        console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
        console.log(error);
    });

Response

{
    "etag": "\"p330afo6os69v40g\"",
    "kind": "calendar#calendarList",
    "nextSyncToken": "CMCn4Njhk_ICEhJhbhzGMjE1OUBnFWbpbC5jb20=",
    "data": [
        {
            "accessRole": "owner",
            "backgroundColor": "#f83a22",
            "colorId": "3",
            "etag": "\"1627956268504000\"",
            "foregroundColor": "#000000",
            "id": "hn1s7q1ckmjqpf4hj2ib2n62ps@group.calendar.google.com",
            "kind": "calendar#calendarListEntry",
            "selected": true,
            "summary": "Demo",
            "timeZone": "Asia/Jakarta",
            "defaultReminders": [],
            "conferenceProperties": {
                "allowedConferenceSolutionTypes": [
                    "hangoutsMeet"
                ]
            }
        }
    ]
}

Get Events Lists

Returns list of events on the specified calendar.

Attention needed
<calendarId> must be URL encoded
GET
<team>/google-calendar/<identifier>/<calendarId>

Parameters

Parameter Description
start Start date (Y-m-d)
end End date (Y-m-d)
orderBy The order of the events returned in the result. default "startTime"
q Free text search terms to find events that match these terms in any field, except for extended properties. Optional.

Example

var axios = require('axios');
var config = {
    method: 'get',
    url: 'https://v1.slashapi.com/slashapi/google-calendar/ax2Q0ZzBni/id.indonesian%23holiday%40group.v.calendar.google.com?start=2021-01-01&end=2021-01-29&orderBy=starttime&q=tahun baru'
};

axios(config)
    .then(function (response) {
        console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
        console.log(error);
    });

Response

{
    "accessRole": "owner",
    "etag": "\"p3248ps71s69v40g\"",
    "kind": "calendar#events",
    "summary": "Demo",
    "timeZone": "Asia/Jakarta",
    "updated": "2021-08-03T02:04:47.637Z",
    "defaultReminders": [],
    "data": [
        {
            "created": "2021-08-01T14:25:53.000Z",
            "etag": "\"3255912575274000\"",
            "eventType": "default",
            "htmlLink": "https://www.google.com/calendar/event?eid=NnNzaW92OTRzYWZycWlsNm9tYjdscGExdjAgaG4xczdxMWNrbWpxcGY0aGoyaWIybjYycHNAZw",
            "iCalUID": "6ssiov94safrqil6omb7lpa1v0@google.com",
            "id": "6ssiov94safrqil6omb7lpa1v0",
            "kind": "calendar#event",
            "sequence": 2,
            "status": "confirmed",
            "summary": "First Event",
            "updated": "2021-08-03T02:04:47.637Z",
            "creator": {
                "email": "alfa2159@gmail.com"
            },
            "organizer": {
                "displayName": "Demo",
                "email": "hn1s7q1ckmjqpf4hj2ib2n62ps@group.calendar.google.com",
                "self": true
            },
            "start": {
                "dateTime": "2021-08-02T06:45:00+07:00"
            },
            "end": {
                "dateTime": "2021-08-02T07:45:00+07:00"
            },
            "reminders": {
                "useDefault": true
            }
        }
    ]
}

Get Event

Get single event data

GET
<team>/google-calendar/<identifier>/<calendarId>/<eventId>

Example

var axios = require('axios');
var config = {
    method: 'get',
    url: 'https://v1.slashapi.com/slashapi/google-calendar/ax2Q0ZzBni/id.indonesian%23holiday%40group.v.calendar.google.com/20210101_2piunva6hrdd5g1bi5bnhgt334'
};

axios(config)
    .then(function (response) {
        console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
        console.log(error);
    });

Response

{
    "data": {
        "created": "2021-08-01T14:25:53.000Z",
        "etag": "\"3255912575274000\"",
        "eventType": "default",
        "htmlLink": "https://www.google.com/calendar/event?eid=NnNzaW92OTRzYWZycWlsNm9tYjdscGExdjAgaG4xczdxMWNrbWpxcGY0aGoyaWIybjYycHNAZw",
        "iCalUID": "6ssiov94safrqil6omb7lpa1v0@google.com",
        "id": "6ssiov94safrqil6omb7lpa1v0",
        "kind": "calendar#event",
        "sequence": 2,
        "status": "confirmed",
        "summary": "First Event",
        "updated": "2021-08-03T02:04:47.637Z",
        "creator": {
            "email": "alfa2159@gmail.com"
        },
        "organizer": {
            "displayName": "Demo",
            "email": "hn1s7q1ckmjqpf4hj2ib2n62ps@group.calendar.google.com",
            "self": true
        },
        "start": {
            "dateTime": "2021-08-02T06:45:00+07:00"
        },
        "end": {
            "dateTime": "2021-08-02T07:45:00+07:00"
        },
        "reminders": {
            "useDefault": true
        }
    }
}

Create an event

Add new event into your calendar

POST
<team>/google-calendar/<identifier>/<calendarId>

Request Body

Parameter Description
attendees[] The attendees of the event
attendees[].additionalGuests Number of additional guests. Optional
attendees[].comment The attendee's response comment. Optional
attendees[].displayName The attendee's name, if available. Optional
attendees[].email The attendee's email address, if available. This field must be present when adding an attendee
attendees[].responseStatus The attendee's response status. Possible values are:
  • "needsAction" - The attendee has not responded to the invitation.
  • "declined" - The attendee has declined the invitation.
  • "tentative" - The attendee has tentatively accepted the invitation.
  • "accepted" - The attendee has accepted the invitation.
description Description of the event. Can contain HTML. Optional.
end.date The date, in the format "yyyy-mm-dd", if this is an all-day event.
end.dateTime The time, as a combined date-time value (formatted according to RFC3339)
end.timeZone The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name
location Geographic location of the event as free-form text. Optional.
source.title Title of the source; for example a title of a web page or an email subject.
source.url URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS.
start.date The date, in the format "yyyy-mm-dd", if this is an all-day event.
start.dateTime The time, as a combined date-time value (formatted according to RFC3339)
start.timeZone The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name
status Status of the event. Optional. Possible values are:
  • "confirmed" - The event is confirmed. This is the default status.
  • "tentative" - The event is tentatively confirmed.
  • "cancelled" - The event is cancelled (deleted).
summary Title of the event.

Example Request Body

{
    "data": {
        "start": {
            "date": "2021-08-05"
        },
        "end": {
            "date": "2021-08-05"
        },
        "attendees": [
            {
                "displayName": "Jane Due",
                "email": "jane@domain.com",
                "responseStatus": "needsAction"
            }
        ],
        "description": "Description of the event",
        "location": "Bandung",
        "summary": "Title of the event"
    }
}

Response

{
    "data": {
        "created": "2021-08-03T02:25:56.000Z",
        "description": "Description of the event",
        "etag": "\"3255915113674000\"",
        "eventType": "default",
        "htmlLink": "https://www.google.com/calendar/event?eid=ZmJmcG1tdnM1bzZya3VqcWFvMG9ha2VwOGMgaG4xczdxMWNrbWpxcGY0aGoyaWIybjYycHNAZw",
        "iCalUID": "fbfpmmvs5o6rkujqao0oakep8c@google.com",
        "id": "fbfpmmvs5o6rkujqao0oakep8c",
        "kind": "calendar#event",
        "location": "Bandung",
        "sequence": 0,
        "status": "confirmed",
        "summary": "Title of the event",
        "updated": "2021-08-03T02:25:56.837Z",
        "creator": {
            "email": "alfa2159@gmail.com"
        },
        "organizer": {
            "displayName": "Demo",
            "email": "hn1s7q1ckmjqpf4hj2ib2n62ps@group.calendar.google.com",
            "self": true
        },
        "start": {
            "date": "2021-08-05"
        },
        "end": {
            "date": "2021-08-05"
        },
        "attendees": [
            {
                "displayName": "Jane Due",
                "email": "jane@domain.com",
                "responseStatus": "needsAction"
            }
        ],
        "reminders": {
            "useDefault": false
        }
    }
}

Update an event

PUT
<team>/google-calendar/<identifier>/<calendarId>/<eventId>

Request Body

Parameter Description
attendees[] The attendees of the event
attendees[].additionalGuests Number of additional guests. Optional
attendees[].comment The attendee's response comment. Optional
attendees[].displayName The attendee's name, if available. Optional
attendees[].email The attendee's email address, if available. This field must be present when adding an attendee
attendees[].responseStatus The attendee's response status. Possible values are:
  • "needsAction" - The attendee has not responded to the invitation.
  • "declined" - The attendee has declined the invitation.
  • "tentative" - The attendee has tentatively accepted the invitation.
  • "accepted" - The attendee has accepted the invitation.
description Description of the event. Can contain HTML. Optional.
end.date The date, in the format "yyyy-mm-dd", if this is an all-day event.
end.dateTime The time, as a combined date-time value (formatted according to RFC3339)
end.timeZone The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name
location Geographic location of the event as free-form text. Optional.
source.title Title of the source; for example a title of a web page or an email subject.
source.url URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS.
start.date The date, in the format "yyyy-mm-dd", if this is an all-day event.
start.dateTime The time, as a combined date-time value (formatted according to RFC3339)
start.timeZone The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name
status Status of the event. Optional. Possible values are:
  • "confirmed" - The event is confirmed. This is the default status.
  • "tentative" - The event is tentatively confirmed.
  • "cancelled" - The event is cancelled (deleted).
summary Title of the event.

Example Request Body

{
    "data": {
        "start": {
            "date": "2021-08-05"
        },
        "end": {
            "date": "2021-08-05"
        },
        "attendees": [
            {
                "displayName": "Jane Due",
                "email": "jane@domain.com",
                "responseStatus": "needsAction"
            }
        ],
        "description": "Description of the event",
        "location": "Bandung",
        "summary": "New Title of the event"
    }
}

Response

{
    "message": "Updated successfully",
    "data": {
        "created": "2021-08-03T02:25:56.000Z",
        "description": "Description of the event",
        "etag": "\"3255918682038000\"",
        "eventType": "default",
        "htmlLink": "https://www.google.com/calendar/event?eid=ZmJmcG1tdnM1bzZya3VqcWFvMG9ha2VwOGMgaG4xczdxMWNrbWpxcGY0aGoyaWIybjYycHNAZw",
        "iCalUID": "fbfpmmvs5o6rkujqao0oakep8c@google.com",
        "id": "fbfpmmvs5o6rkujqao0oakep8c",
        "kind": "calendar#event",
        "location": "Bandung",
        "sequence": 0,
        "status": "confirmed",
        "summary": "New Title of the event",
        "updated": "2021-08-03T02:55:41.019Z",
        "creator": {
            "email": "alfa2159@gmail.com"
        },
        "organizer": {
            "displayName": "Demo",
            "email": "hn1s7q1ckmjqpf4hj2ib2n62ps@group.calendar.google.com",
            "self": true
        },
        "start": {
            "date": "2021-08-05"
        },
        "end": {
            "date": "2021-08-05"
        },
        "attendees": [
            {
                "displayName": "Jane Due",
                "email": "jane@domain.com",
                "responseStatus": "needsAction"
            }
        ],
        "reminders": {
            "useDefault": false
        }
    }
}

Delete an event

DELETE
<team>/google-calendar/<identifier>/<calendarId>/<eventId>

Response

{
    "message": "deleted successfully"
}