🕢Events

Google Calendar Events

Get All Events From a Calendar

Get List of Events

GET https://api.pyas.io/google/events

Gets all events from a calendar

Query Parameters

NameTypeDescription

calendarId*

String

The id of the Google calendar

accountId*

String

The user's Pyas account id. This is returned when you connect an account to Pyas.

startDate

Date String

Filter events by start date

(ex: 01-01-2022)

endDate

Date String

Filter events by end time

(ex: 01-01-2023)

search

String

Free text search terms to find events that match these terms in the following fields: summary, description, location, attendee's displayName, attendee's email.

nextPageToken

String

Token string used to get the next page of results (paginate)

maxResults

Integer

Max number of results to return per page

syncToken

String

Token obtained from the nextSyncToken field returned on the last page of results

filters

JSON

All other filters provides as JSON key-value pairs.

ex: {"singleEvents": true}

See possible filters list below.

Headers

NameTypeDescription

x-api-key*

String

API key

{
    "success": true,
    "data": {
        "nextSyncToken": string|null,
        "nextPageToken": string|null,
        "events": [
            {
                "kind": "calendar#event",
                "etag": "\"00000\"",
                "id": "string",
                "status": "confirmed",
                "htmlLink": "string",
                "created": "2023-01-05T01:56:37.000Z",
                "updated": "2023-01-05T01:56:38.403Z",
                "summary": "some summary",
                "description": "some description",
                "creator": {
                    "email": "string"
                },
                "organizer": {
                    "email": "string"
                },
                "start": {
                    "dateTime": "2023-01-11T13:00:00-05:00",
                    "timeZone": "UTC"
                },
                "end": {
                    "dateTime": "2023-01-11T13:15:00-05:00",
                    "timeZone": "UTC"
                },
                "iCalUID": "string",
                "sequence": 0,
                "attendees": [
                    {
                        "email": "string",
                        "organizer": true,
                        "responseStatus": "string"
                    },
                    {
                        "email": "string",
                        "self": true,
                        "responseStatus": "stringd"
                    }
                ],
                "reminders": {
                    "useDefault": boolean
                },
                "eventType": "string"
            },
        ]
    }
}

List of Possible Filters

Below is a list of flags/filters that can be used when listing events. Simply send these as JSON in the filters parameter.

'eventTypes',
'iCalUID',
'maxAttendees',
'maxResults',
'orderBy',
'privateExtendedProperty',
'sharedExtendedProperty',
'showDeleted',
'showHiddenInvitations',
'singleEvents',
'timeZone',
'updatedMin',

Get an Event By ID

Get Event by ID

GET https://api.pyas.io/google/events/:id

Gets a calendar event by id

Path Parameters

NameTypeDescription

{id}*

String

The event id

Query Parameters

NameTypeDescription

calendarId*

String

The Google Calendar id

accountId*

String

The user's Pyas account id. This is returned when you connect an account to Pyas.

Headers

NameTypeDescription

x-api-key*

String

API key

{
    "success": true,
    "data": {
        "event": {
            "kind": "calendar#event",
            "etag": "\"00000000\"",
            "id": "string",
            "status": "string",
            "htmlLink": "string",
            "created": "2023-01-05T01:56:37.000Z",
            "updated": "2023-01-05T01:56:38.403Z",
            "summary": "some summary",
            "description": "some description"
                "email": "string"
            },
            "organizer": {
                "email": "string"
            },
            "start": {
                "dateTime": "2023-01-11T13:00:00-05:00",
                "timeZone": "UTC"
            },
            "end": {
                "dateTime": "2023-01-11T13:15:00-05:00",
                "timeZone": "UTC"
            },
            "iCalUID": "string",
            "sequence": 0,
            "attendees": [
                {
                    "email": "string",
                    "organizer": true,
                    "responseStatus": "accepted"
                },
                {
                    "email": "string",
                    "self": true,
                    "responseStatus": "accepted"
                }
            ],
            "reminders": {
                "useDefault": true
            },
            "eventType": "default"
        }
    }
}

Create an Event

Create Event

POST https://api.pyas.io/google/events

Creates a calendar event

Headers

NameTypeDescription

x-api-key*

String

API key

Request Body

NameTypeDescription

accountId*

String

The user's Pyas account id. This is returned when you connect an account to Pyas.

calendarId*

String

The Google calendar id

eventData*

Object

The event data. See the Required Event Data Object example below.

eventData.title*

String

The event title

eventData.description*

String

Event description

eventData.startDate*

DateTime

RFC3339 Timestamp

eventData.endDate*

DateTime

RFC3339 Timestamp

eventData.timeZone

String

Time Zone in IANA format

eventData.location

Object

Location object - See the example Event Location Object

eventData.attendees

Array

eventData.conferencing

Object

eventData.phone

String

Phone number

eventData.phonePin

String

Optional pin if one is required to join the meeting

eventData.recurrence

Object

Recurrence object for recurring events. See the Recurrence Object below.

{
    "success": true,
    "data": {
        "kind": "calendar#event",
        "etag": "\"000000000000000\"",
        "id": "string",
        "status": "confirmed",
        "htmlLink": "string",
        "created": "2023-03-06T23:06:14.000Z",
        "updated": "2023-03-06T23:06:14.350Z",
        "summary": "Example Event",
        "description": "example",
        "location": "712 Applesauce Rd Austin, TX 73301",
        "creator": {
            "email": "example@gmail.com",
            "self": true
        },
        "organizer": {
            "email": "example@gmail.com",
            "self": true
        },
        "start": {
            "dateTime": "2023-03-06T18:06:12-05:00",
            "timeZone": "America/New_York"
        },
        "end": {
            "dateTime": "2023-03-06T18:36:12-05:00",
            "timeZone": "America/New_York"
        },
        "iCalUID": "string",
        "sequence": 0,
        "attendees": [
            {
                "email": "example@gmail.com",
                "displayName": "Jane Doe",
                "responseStatus": "needsAction"
            }
        ],
        "reminders": {
            "useDefault": true
        },
        "eventType": "default"
    }
}

Event Data Object Example:

{
      "title": "Example Event", // String - Required.
      "description": "example", // String - Required.
      "startDate": "2023-03-06T22:51:08.434Z", // RFC3339 timestamp  - Required.
      "endDate": "2023-03-06T23:21:08.434Z", // RFC3339 timestamp - Required.
      "timeZone": "America/New_York", // IANA Time Zone format - Optional.
       "location": {
          "street": "712 Applesauce Rd",
          "city": "Austin",
          "state": "TX",
          "zipCode": "73301",
          "country": "USA"
      }, // Object - Optional. (required when creating an event with a physocal location)
      "attendees": [
          {
              "name": "Jane Doe",
              "email": "example@gmail.com"
          }
         
      ] // Required.
        
}

Event Location Object Example:

{
    "street": "712 Applesauce Rd", // String - Required.
    "city": "Austin", // String - Required.
    "state": "TX", // String - Required.
    "zipCode": "73301", // String - Required.
    "country": "USA" // String - Required.
},

Attendee Object Example:

{
    "name": "Jane Doe", // String - Required.
    "email": "example@gmail.com" // String - Required.
}

Event Conferencing Object:

{
    "provider": string, // Required. Possible values: "google-meet", "zoom"
    "accountId": string, // Optional. - Only Required if provider = zoom. This is the ID for the connected Zoom account in Pyas.
    "waitingRoom": boolean // Optional. - Only Required if provider = zoom
}

Event Data With Google Meet Conferencing Example:

{
        "title": "Example Event 2",
        "description": "example",
        "startDate": "2023-03-06T22:51:08.434Z",
        "endDate": "",
        "conferencing": {
            "provider": "google-meet"
        },
        "timeZone": "America/New_York",
        "attendees": [
            {
                "name": "Jane Doe",
                "email": "example@gmail.com"
            }
        ]
        
}

Recurrence Object:

{
    type: string // daily, weekly, or monthly - Required.
    interval: number|string // Define the interval at which the meeting should recur. (ex. 2 for every two weeks with type of weekly) - Required.
    startDate?: string // the dateTime of when the recurring meeting will start (used for Microsoft Outlook only)
    endDate?: string // the dateTime of when the recurring meeting will end
    dayOfMonth?: number|string // day of month for a monthly meeting. 1 - 31 (ex. 15 for the 15th of every month)
    daysOfWeek?: Array<string> // days of week for a weekly meeting type (ex. ['monday', 'wednesday'])
    month?: number|string // The month in which the event occurs. This is a number from 1 to 12. (Microsoft and Google only)
}

Here's an example of a recurrence object for a meeting that repeats weekly every Wednesday:

{
    "type": "weekly",
    "interval": 1,
    "daysOfWeek": ["wednesday"],
    "endDate": "2023-08-01T22:26:39.109Z"
}

Update an Event

Update Event

PATCH https://api.pyas.io/google/events/:id

Updates an Existing Event

Path Parameters

NameTypeDescription

{id}*

String

The event ID

Headers

NameTypeDescription

x-api-key*

String

API Key

Request Body

NameTypeDescription

accountId*

String

The user's Pyas account id. This is returned when you connect an account to Pyas.

calendarId*

String

The Google calendar id

eventData*

Object

Event data object with the fields to update. See the Example Update Event Date Object below.

{
    "success": true,
    "data": {
        "kind": "calendar#event",
        "etag": "\"000000000\"",
        "id": "ae019d68ac9b4ff6823d5c3b81d761f9",
        "status": "confirmed",
        "htmlLink": "string",
        "created": "2023-03-08T18:34:01.000Z",
        "updated": "2023-03-08T18:46:43.015Z",
        "summary": "Interview",
        "description": "Interview with Elon",
        "location": "712 Applesauce Rd Austin, TX 73301",
        "creator": {
            "email": "example@gmail.com",
            "self": true
        },
        "organizer": {
            "email": "example@gmail.com",
            "self": true
        },
        "start": {
            "dateTime": "2023-03-08T15:16:40-05:00",
            "timeZone": "America/New_York"
        },
        "end": {
            "dateTime": "2023-03-08T15:46:40-05:00",
            "timeZone": "America/New_York"
        },
        "iCalUID": "string",
        "sequence": 1,
        "attendees": [
            {
                "email": "example@gmail.com",
                "displayName": "Jane Doe",
                "responseStatus": "needsAction"
            }
        ],
        "reminders": {
            "useDefault": true
        },
        "eventType": "default"
    }
}

Update Event Data Object Example:

{
        "title": "Interview",
        "description": "Interview with Elon",
        "startDate": "2023-03-06T22:51:08.434Z",
        "endDate": "2023-03-06T23:21:08.434Z",
        "timeZone": "America/New_York"
       
}

Delete an Event

Delete Event

DELETE https://api.pyas.io/google/events/:id

Deletes an existing event

Path Parameters

NameTypeDescription

{id}*

String

The event ID

Query Parameters

NameTypeDescription

accountId

String

The user's Pyas account id. This is returned when you connect an account to Pyas.

calendarId*

String

The Google calendar ID

Headers

NameTypeDescription

x-api-key*

String

API Key

{
    // Response
}

Last updated