Google Calendar Webhook

This page contains the various webhook paths to perform management functions on Google Calendar

Get calendar-list/

Get a list of calendars associated with the Google Account integrated with the given MindX account. Returns a list of calendars.

Headers:

{
    "Authorization": "Token {MindX Bearer Token}"
}

Returns:

[
    {
        "id": "email1@mind.ai",
        "summary": "Holidays in Thailand",
        "description": "Holidays and Observances in Thailand",
        "timeZone": "Asia/Bangkok"
    },
    {
        "id": "email2@mind.ai",
        "summary": "tawan@mind.ai",
        "description": "",
        "timeZone": "Asia/Bangkok"
    },
    {
        "id": "email3@mind.ai",
        "summary": "Birthdays",
        "description": "Displays birthdays, anniversaries, and other event dates of people in Google Contacts.",
        "timeZone": "Asia/Bangkok"
    }
]

POST events/list/

Get a list of events scheduled during the given time. date_start and date_end can should be an ISO formatted datetime string, for example, 2023-03-28T01:25:48.232Z; but it can also accepts fuzzy date/time sentences and will try its best to figure out.

For example, setting date_start as next Tuesday at 5PM should correctly convert it to the date and time for next Tuesday at 5PM.

Note that it only accepts day of the week. It does NOT accept relative days such as today or tomorrow.

Returns a list of CalendarEvent Object that fits the query parameters.

Headers:

{
    "Authorization": "Token {MindX Google API Key}"
}

Requests:

KeyRequiredDescription

date_start

String of the starting date for the event query.

date_end

String of the end date for the event query. Defaults to one hour after date_start time.

time_zone

Timezone in UTC+07 format to be used for the return values. Defaults to UTC.

calendar

Google Calendar ID to query events from.

  • Examples:

{
  "date_start": "tuesday at 8PM",
  "date_end": "friday at noon",
  "time_zone": "+0700",
  "calendar": "email1@mind.ai"
}
{
  "date_start": "2023-03-28T01:25:48.232+05:00",
  "time_zone": "+0500",
  "calendar": "email1@mind.ai"
}

Returns:

[
    {
        "id": "smrv8spl97ic74nb5cfap0d9n4",
        "summary": "Test from Mindx",
        "description": "Testing creating event from MindX",
        "start": {
            "dateTime": "2023-03-29T22:00:00+07:00",
            "timeZone": "UTC"
        },
        "end": {
            "dateTime": "2023-03-30T01:00:00+07:00",
            "timeZone": "UTC"
        },
        "attendees": []
    },
    {
        "id": "gn44uc56ujdpbknu1g46knopic",
        "summary": "A Test Event",
        "description": "This is an event created for testing purposes.",
        "start": {
            "dateTime": "2023-03-30T00:00:00+07:00",
            "timeZone": "UTC+07:00"
        },
        "end": {
            "dateTime": "2023-03-30T03:00:00+07:00",
            "timeZone": "UTC+07:00"
        },
        "attendees": [
            {
                "email": "email2@gmail.com",
                "responseStatus": "declined"
            }
        ]
    },
    {
        "id": "r08gh5p5tgr3s783h92754ljao",
        "summary": "New Test Event",
        "description": "This is a test event.",
        "start": {
            "dateTime": "2023-03-30T00:00:00+07:00",
            "timeZone": "UTC+07:00"
        },
        "end": {
            "dateTime": "2023-03-30T03:00:00+07:00",
            "timeZone": "UTC+07:00"
        },
        "attendees": [
            {
                "email": "email2@gmail.com",
                "responseStatus": "declined"
            }
        ]
    }
]

POST events/delete/

Delete the given event from the given calendar. Can be set to notify all attendees. Return success status.

Headers:

{
    "Authorization": "Token {MindX Google API Key}"
}

Requests:

KeyRequiredDescription

calendar

Calendar ID for the event.

event_id

Event ID to be deleted.

notify

Whether to notify all attendees of the deletion.

  • Examples:

{
    "calendar": "email1@mind.ai",
    "event_id": "r08gh5p5tgr3s783h92754ljao",
    "notify": true
}

Returns:

{
    "success": true | false
}

POST events/new/

Create a new calendar event for the given calendar with the details in the payload.

Headers:

{
    "Authorization": "Token {MindX Google API Key}"
}

Requests:

KeyRequiredDescription

calendar

Calendar ID for the event.

summary

Event summary / Title

description

Description for the event.

date_start

Starting date/time for the event

date_end

Ending date/time for the event. Defaults to 1 hour after starting time.

time_zone

Timezone of the times to be given as the return values. Defaults to UTC

  • Examples:

{
    "calendar": "email1@mind.ai",
    "summary": "New Testing",
    "description": "Testing a new event",
    "date_start": "friday at 9am",
    "date_end": "2023-04-01T11:00:00+07:00",
    "time_zone": "UTC+07"
}

Returns:

{
    "id": "qckslmunocuaojksbd3ld5e65g",
    "summary": "New Testing",
    "description": "Testing a new event",
    "start": {
        "dateTime": "2023-03-31T09:00:00+07:00",
        "timeZone": "UTC+07:00"
    },
    "end": {
        "dateTime": "2023-04-01T11:00:00+07:00",
        "timeZone": "UTC+07:00"
    },
    "attendees": []
}

POST events/attendees/

Add new attendees to the event.

Headers:

{
    "Authorization": "Token {MindX Google API Key}"
}

Requests:

KeyRequiredDescription

calendar

Calendar ID for the event.

event_id

ID for the event to add attendees to.

emails

A list of emails to be added to the event.

  • Examples:

{
  "calendar": "email1@mind.ai",
  "event_id": "qckslmunocuaojksbd3ld5e65g",
  "emails": [
    "email2@mind.ai",
    "email3@mind.ai"
  ]
}

Returns:

{
    "id": "qckslmunocuaojksbd3ld5e65g",
    "summary": "New Testing",
    "description": "Testing a new event",
    "start": {
        "dateTime": "2023-03-31T02:00:00+07:00",
        "timeZone": "UTC+07:00"
    },
    "end": {
        "dateTime": "2023-04-01T11:00:00+07:00",
        "timeZone": "UTC+07:00"
    },
    "attendees": [
        {
        "email": "email2@mind.ai",
        "responseStatus": "needsAction"
        },
        {
        "email": "email3@mind.ai",
        "responseStatus": "needsAction"
        }
    ]
}

POST events/details/

Get the details for the event ID.

Headers:

{
    "Authorization": "Token {MindX Google API Key}"
}

Requests:

KeyRequiredDescription

calendar

Calendar ID for the event.

event_id

ID for the event to add attendees to.

  • Examples:

{
  "calendar": "email1@mind.ai",
  "event_id": "qckslmunocuaojksbd3ld5e65g"
}

Returns:

{
    "id": "qckslmunocuaojksbd3ld5e65g",
    "summary": "New Testing",
    "description": "Testing a new event",
    "start": {
        "dateTime": "2023-03-31T02:00:00+07:00",
        "timeZone": "UTC+07:00"
    },
    "end": {
        "dateTime": "2023-04-01T11:00:00+07:00",
        "timeZone": "UTC+07:00"
    },
    "attendees": [
        {
        "email": "email2@mind.ai",
        "responseStatus": "needsAction"
        },
        {
        "email": "email3@mind.ai",
        "responseStatus": "needsAction"
        }
    ]
}

POST events/time/

Change the time of the event.

Headers:

{
    "Authorization": "Token {MindX Google API Key}"
}

Requests:

calendar

Calendar ID for the event.

event_id

ID for the event to add attendees to.

date_start

Starting date/time for the event

date_end

Ending date/time for the event. Defaults to 1 hour after starting time.

time_zone

Timezone of the times to be given as the return values. Defaults to UTC

  • Examples:

{
    "calendar": "email1@mind.ai",
    "event_id": "qckslmunocuaojksbd3ld5e65g",
    "date_start": "friday at 9am",
    "date_end": "2023-04-01T11:00:00+07:00",
    "time_zone": "UTC+07"
}

Returns:

{
    "id": "qckslmunocuaojksbd3ld5e65g",
    "summary": "New Testing",
    "description": "Testing a new event",
    "start": {
        "dateTime": "2023-03-31T02:00:00+07:00",
        "timeZone": "UTC+07:00"
    },
    "end": {
        "dateTime": "2023-04-01T11:00:00+07:00",
        "timeZone": "UTC+07:00"
    },
    "attendees": [
        {
        "email": "email2@mind.ai",
        "responseStatus": "needsAction"
        },
        {
        "email": "email3@mind.ai",
        "responseStatus": "needsAction"
        }
    ]
}

POST events/freebusy/

Given the time range, returns whether the owner of the calendar is free or not.

Headers:

{
    "Authorization": "Token {MindX Google API Key}"
}

Requests:

KeyRequiredDescription

calendar

Calendar ID for the event.

date_start

Starting date/time for the event

date_end

Ending date/time for the event. Defaults to 1 hour after starting time.

time_zone

Timezone of the times to be given as the return values. Defaults to UTC

  • Examples:

{
    "calendar": "email1@mind.ai",
    "date_start": "friday at 9am",
    "date_end": "2023-04-01T11:00:00+07:00",
    "time_zone": "UTC+07"
}

Returns:

{
    "free": true
}

Last updated