Events: insert

이벤트를 만듭니다. 지금 사용해 보기 또는 예시를 확인하세요.

요청

HTTP 요청

POST https://www.googleapis.com/calendar/v3/calendars/calendarId/events

매개변수

매개변수 이름 설명
경로 매개변수
calendarId string 캘린더 식별자입니다. 캘린더 ID를 검색하려면 calendarList.list 메서드를 호출합니다. 현재 로그인한 사용자의 기본 캘린더에 액세스하려면 'primary' 키워드를 사용하세요.
선택적 쿼리 매개변수
conferenceDataVersion integer API 클라이언트에서 지원하는 회의 데이터의 버전 번호입니다. 버전 0은 회의 데이터 지원이 없다고 가정하고 일정 본문에 있는 회의 데이터를 무시합니다. 버전 1을 사용하면 ConferenceData 복사 및 conferenceData의 createRequest 필드를 사용한 새로운 회의 생성이 지원됩니다. 기본값은 0입니다. 사용 가능한 값: 0~1.
maxAttendees integer 응답에 포함할 최대 참석자 수입니다. 참석자가 지정된 수보다 많은 경우 참석자만 반환됩니다. 선택사항입니다.
sendNotifications boolean 지원이 중단되었습니다. 대신 sendUpdates를 사용하세요.

새 이벤트 생성에 관한 알림을 전송할지 여부입니다. 값을 false로 설정해도 일부 이메일은 계속 전송될 수 있습니다. 기본값은 false입니다.
sendUpdates string 새 이벤트 생성에 관한 알림을 전송할지 여부입니다. 일부 이메일은 계속 전송될 수 있습니다. 기본값은 false입니다.

사용 가능한 값은 다음과 같습니다.
  • 'all': 모든 참석자에게 알림이 전송됩니다.
  • 'externalOnly': Google Calendar를 사용하지 않는 참석자에게만 알림이 전송됩니다.
  • 'none': 알림이 전송되지 않습니다.
supportsAttachments boolean 작업을 수행하는 API 클라이언트가 이벤트 연결을 지원하는지 여부입니다. 선택사항입니다. 기본값은 False입니다.

승인

이 요청을 처리하려면 다음 범위 중 하나 이상을 사용한 승인이 필요합니다.

범위
https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/calendar.events

자세한 내용은 인증 및 승인 페이지를 참고하세요.

요청 본문

요청 본문에서는 다음과 같은 속성을 사용하여 이벤트 리소스를 제공합니다.

속성 이름 설명 Notes
필수 속성
end nested object 이벤트의 (제외) 종료 시간입니다. 반복 일정의 경우 첫 번째 일정의 종료 시간입니다.
start nested object 이벤트의 시작 시간입니다 (해당 시간 포함). 반복 일정의 경우 첫 번째 인스턴스의 시작 시간입니다.
선택적 속성
anyoneCanAddSelf boolean 누구나 일정에 자신을 초대할 수 있는지 여부입니다 (지원 중단됨). 선택사항입니다. 기본값은 False입니다. 쓰기 가능
attachments[].fileUrl string 첨부파일에 대한 URL 링크입니다.

Google Drive 첨부파일을 추가하려면 Drive API에서 Files 리소스의 alternateLink 속성과 동일한 형식을 사용합니다.

첨부파일을 추가할 때 필요합니다.

쓰기 가능
attendees[] list 이벤트의 참석자입니다. 다른 캘린더 사용자와 함께 일정을 예약하는 방법에 대한 자세한 내용은 참석자가 있는 일정 가이드를 참조하세요. 참석자 목록을 채우려면 서비스 계정에서 도메인 전체 권한 위임을 사용해야 합니다. 쓰기 가능
attendees[].additionalGuests integer 추가 투숙객 수입니다. 선택사항입니다. 기본값은 0입니다. 쓰기 가능
attendees[].comment string 참석자의 응답 댓글입니다. 선택사항입니다. 쓰기 가능
attendees[].displayName string 참석자의 이름(사용 가능한 경우). 선택사항입니다. 쓰기 가능
attendees[].email string 참석자의 이메일 주소입니다(있는 경우). 참석자를 추가할 때 이 필드가 있어야 합니다. RFC5322에 따라 유효한 이메일 주소여야 합니다.

참석자를 추가할 때 필요합니다.

쓰기 가능
attendees[].optional boolean 선택적 참석자인지 여부입니다. 선택사항입니다. 기본값은 False입니다. 쓰기 가능
attendees[].resource boolean 참석자가 리소스인지 여부입니다. 참석자가 처음으로 일정에 추가되는 경우에만 설정할 수 있습니다. 후속 수정은 무시됩니다. 선택사항입니다. 기본값은 False입니다. 쓰기 가능
attendees[].responseStatus string 참석자의 응답 상태입니다. 가능한 값은 다음과 같습니다.
  • 'needsAction' - 참석자가 초대에 응답하지 않았습니다 (새 일정에 권장됨).
  • 'declined' - 참석자가 초대를 거부했습니다.
  • 'tentative' - 참석자가 미정으로 초대를 수락했습니다.
  • 'accepted' - 참석자가 초대를 수락했습니다.
쓰기 가능
colorId string 이벤트의 색상입니다. 색상 정의의 event 섹션에 있는 항목을 참조하는 ID입니다 ( 색상 엔드포인트 참고). 선택사항입니다. 쓰기 가능
conferenceData nested object 회의 관련 정보(예: Google Meet 회의 세부정보)입니다. 새 회의 세부정보를 만들려면 createRequest 입력란을 사용합니다. 변경사항을 유지하려면 모든 이벤트 수정 요청에서 conferenceDataVersion 요청 매개변수를 1로 설정해야 합니다. 쓰기 가능
description string 이벤트에 관한 설명입니다. HTML을 포함할 수 있습니다. 선택사항입니다. 쓰기 가능
end.date date 종일 일정인 경우 'yyyy-mm-dd' 형식의 날짜입니다. 쓰기 가능
end.dateTime datetime 결합된 날짜-시간 값으로 표시되는 시간입니다 (RFC3339에 따라 형식 지정). timeZone에 시간대가 명시적으로 지정되지 않은 경우 시간대 오프셋이 필요합니다. 쓰기 가능
end.timeZone string 시간이 지정된 시간대입니다. (IANA 시간대 데이터베이스 이름 형식(예: '유럽/취리히')입니다.) 반복 이벤트의 경우 이 필드는 필수이며 반복이 확장되는 시간대를 지정합니다. 단일 이벤트의 경우 이 필드는 선택사항이며 이벤트 시작/종료의 맞춤 시간대를 나타냅니다. 쓰기 가능
eventType string 이벤트의 특정 유형입니다. 이벤트를 만든 후에는 수정할 수 없습니다. 가능한 값은 다음과 같습니다.
  • 'default' - 정기 이벤트이거나 별도로 지정되지 않습니다.
  • 'outOfOffice': 부재중 일정
  • 'focusTime': 방해 금지 시간 이벤트
  • 'workingLocation': 근무 위치 이벤트
현재 'default ' 및 'workingLocation' 이벤트만 API를 사용하여 만들 수 있습니다. 다른 이벤트 유형에 대한 확장된 지원은 향후 출시에서 제공될 예정입니다.
쓰기 가능
extendedProperties.private object 이 캘린더에 표시되는 일정의 사본에만 적용되는 속성입니다. 쓰기 가능
extendedProperties.shared object 다른 참석자의 캘린더에 있는 일정 사본 간에 공유되는 속성입니다. 쓰기 가능
focusTimeProperties nested object 방해 금지 시간 이벤트 데이터 eventTypefocusTime인 경우 사용됩니다. 쓰기 가능
gadget.display string 가젯의 표시 모드 지원이 중단되었습니다. 가능한 값은 다음과 같습니다.
  • 'icon' - 캘린더 보기에서 일정 제목 옆에 가젯이 표시됩니다.
  • 'chip' - 일정을 클릭하면 가젯이 표시됩니다.
쓰기 가능
gadget.height integer 픽셀 단위의 가젯 높이입니다. 높이는 0보다 큰 정수여야 합니다. 선택사항입니다. 지원이 중단되었습니다. 쓰기 가능
gadget.preferences object 환경설정을 탭합니다. 쓰기 가능
gadget.title string 가젯의 제목입니다. 지원이 중단되었습니다. 쓰기 가능
gadget.type string 가젯 유형. 지원이 중단되었습니다. 쓰기 가능
gadget.width integer 픽셀 단위의 가젯 너비입니다. 너비는 0보다 큰 정수여야 합니다. 선택사항입니다. 지원이 중단되었습니다. 쓰기 가능
guestsCanInviteOthers boolean 주최자가 아닌 참석자가 일정에 다른 사용자를 초대할 수 있는지 여부입니다. 선택사항입니다. 기본값은 True입니다. 쓰기 가능
guestsCanModify boolean 주최자 이외의 참석자가 일정을 수정할 수 있는지를 나타냅니다. 선택사항입니다. 기본값은 False입니다. 쓰기 가능
guestsCanSeeOtherGuests boolean 주최자 이외의 참석자가 일정 참석자를 볼 수 있는지를 나타냅니다. 선택사항입니다. 기본값은 True입니다. 쓰기 가능
id string 이벤트의 불투명 식별자입니다. 새로운 단일 일정 또는 반복 일정을 만들 때 ID를 지정할 수 있습니다. 제공된 ID는 다음 규칙을 따라야 합니다.
  • ID에 허용되는 문자는 base32hex 인코딩에 사용되는 문자(예: 소문자 a~v 및 숫자 0~9)입니다.RFC2938의 섹션 3. 1.2를 참조하세요.
  • ID 길이는 5~1,024자(영문 기준)여야 합니다.
  • ID는 캘린더마다 고유해야 합니다.
전 세계에 분산된 시스템 특성으로 인해 이벤트 생성 시 ID 충돌이 감지된다고 보장할 수 없습니다. 충돌 위험을 최소화하려면 RFC4122에 설명된 것과 같은 기존의 UUID 알고리즘을 사용하는 것이 좋습니다.

ID를 지정하지 않으면 서버에서 자동으로 생성합니다.

icalUIDid는 동일하지 않으며 이벤트 생성 시 둘 중 하나만 제공해야 합니다. 시맨틱의 한 가지 차이점은 반복 이벤트에서 한 이벤트의 모든 일치하는 id가 모두 동일한 icalUID을 공유한다는 것입니다.

쓰기 가능
location string 자유 형식 텍스트로 된 이벤트의 지리적 위치입니다. 선택사항입니다. 쓰기 가능
originalStartTime.date date 종일 일정인 경우 'yyyy-mm-dd' 형식의 날짜입니다. 쓰기 가능
originalStartTime.dateTime datetime 결합된 날짜-시간 값으로 표시되는 시간입니다 (RFC3339에 따라 형식 지정). timeZone에 시간대가 명시적으로 지정되지 않은 경우 시간대 오프셋이 필요합니다. 쓰기 가능
originalStartTime.timeZone string 시간이 지정된 시간대입니다. (IANA 시간대 데이터베이스 이름 형식(예: '유럽/취리히')입니다.) 반복 이벤트의 경우 이 필드는 필수이며 반복이 확장되는 시간대를 지정합니다. 단일 이벤트의 경우 이 필드는 선택사항이며 이벤트 시작/종료의 맞춤 시간대를 나타냅니다. 쓰기 가능
outOfOfficeProperties nested object 부재중 일정 데이터입니다. eventTypeoutOfOffice인 경우 사용됩니다. 쓰기 가능
recurrence[] list RFC5545에 명시된 대로 반복 일정의 RRULE, EXRULE, RDATE, EXDATE 행 목록입니다. 이 필드에는 DTSTART 및 DTEND 행이 허용되지 않습니다. 이벤트 시작 및 종료 시간은 startend 필드에서 지정됩니다. 단일 일정 또는 반복 일정의 경우 이 입력란이 생략됩니다. 쓰기 가능
reminders.overrides[] list 일정에서 기본 알림을 사용하지 않는 경우 일정 관련 알림이 나열됩니다. 설정되지 않은 경우 이 일정에 설정된 알림이 없음을 나타냅니다. 최대 재정의 알림 수는 5개입니다. 쓰기 가능
reminders.overrides[].method string 이 알림에서 사용되는 메서드입니다. 가능한 값은 다음과 같습니다.
  • "email" - 알림이 이메일로 전송됩니다.
  • 'popup' - 알림이 UI 팝업을 통해 전송됩니다.

알림을 추가할 때 필요합니다.

쓰기 가능
reminders.overrides[].minutes integer 이벤트가 시작되기 전에 알림이 트리거되어야 하는 시간(분)입니다. 유효한 값은 0~40320 (분 기준 4주) 사이입니다.

알림을 추가할 때 필요합니다.

쓰기 가능
reminders.useDefault boolean 캘린더의 기본 알림을 일정에 적용할지 여부입니다. 쓰기 가능
sequence integer iCalendar에 따른 순서 번호 쓰기 가능
source.title string 출처의 제목입니다(예: 웹페이지 제목 또는 이메일 제목). 쓰기 가능
source.url string 리소스를 가리키는 소스의 URL입니다. URL 스키마는 HTTP 또는 HTTPS여야 합니다. 쓰기 가능
start.date date 종일 일정인 경우 'yyyy-mm-dd' 형식의 날짜입니다. 쓰기 가능
start.dateTime datetime 결합된 날짜-시간 값으로 표시되는 시간입니다 (RFC3339에 따라 형식 지정). timeZone에 시간대가 명시적으로 지정되지 않은 경우 시간대 오프셋이 필요합니다. 쓰기 가능
start.timeZone string 시간이 지정된 시간대입니다. (IANA 시간대 데이터베이스 이름 형식(예: '유럽/취리히')입니다.) 반복 이벤트의 경우 이 필드는 필수이며 반복이 확장되는 시간대를 지정합니다. 단일 이벤트의 경우 이 필드는 선택사항이며 이벤트 시작/종료의 맞춤 시간대를 나타냅니다. 쓰기 가능
status string 이벤트의 상태입니다. 선택사항입니다. 가능한 값은 다음과 같습니다.
  • 'confirmed' - 이벤트가 확인되었습니다. 기본 상태입니다.
  • 'tentative' - 이벤트가 잠정적으로 확인되었습니다.
  • 'cancelled' - 이벤트가 취소되었습니다 (삭제됨). list 메서드는 증분 동기화 (syncToken 또는 updatedMin가 지정된 경우) 또는 showDeleted 플래그가 true로 설정된 경우에만 취소된 이벤트를 반환합니다. get 메서드는 항상 이 값을 반환합니다.

    취소됨 상태는 이벤트 유형에 따라 두 가지 서로 다른 상태를 나타냅니다.

    1. 취소되지 않은 반복 일정의 취소된 예외는 이 인스턴스가 더 이상 사용자에게 표시되지 않아야 함을 나타냅니다. 클라이언트는 상위 반복 일정의 전체 기간 동안 이러한 일정을 저장해야 합니다.

      취소된 예외에는 id, recurringEventId, originalStartTime 필드의 값만 채워집니다. 다른 필드는 비어 있을 수 있습니다.

    2. 다른 모든 취소된 이벤트는 삭제된 이벤트를 나타냅니다. 클라이언트는 로컬로 동기화된 사본을 삭제해야 합니다. 취소된 이벤트는 결국 사라지므로 무기한으로 사용할 수 있다고 생각하지 마세요.

      삭제된 이벤트에는 id 필드만 채워집니다.

    주최자의 캘린더에서 취소된 일정에는 복원 (삭제 취소)이 가능하도록 일정 세부정보 (요약, 위치 등)가 계속 표시됩니다. 마찬가지로 사용자가 초대를 받았거나 사용자가 수동으로 삭제한 일정에도 계속해서 세부정보가 표시됩니다. 그러나 showDeleted가 false로 설정된 증분 동기화 요청은 이러한 세부정보를 반환하지 않습니다.

    일정의 주최자가 변경되고 (예: move 작업을 통해) 원래 주최자가 참석자 목록에 없는 경우 id 필드만 채워진 상태로 취소된 일정이 남게 됩니다.

쓰기 가능
summary string 이벤트의 제목입니다. 쓰기 가능
transparency string 일정이 캘린더의 시간을 차단할지 여부입니다. 선택사항입니다. 가능한 값은 다음과 같습니다.
  • 'opaque' - 기본값 이 일정은 캘린더의 시간을 차단합니다. 이는 캘린더 UI에서 내 상태다른 용무 중으로 설정하는 것과 같습니다.
  • 'transparent': 일정이 캘린더의 시간을 차단하지 않습니다. 이는 캘린더 UI에서 내 상태확인 가능으로 설정하는 것과 같습니다.
쓰기 가능
visibility string 이벤트의 공개 상태입니다. 선택사항입니다. 가능한 값은 다음과 같습니다.
  • 'default': 캘린더 일정의 기본 공개 상태를 사용합니다. 기본값입니다.
  • 'public' - 일정이 공개되며 일정 세부정보가 캘린더의 모든 독자에게 표시됩니다.
  • 'private' - 일정이 비공개이며 일정 참석자만 일정 세부정보를 볼 수 있습니다.
  • 'confidential' - 비공개 일정입니다. 이 값은 호환성을 위해 제공됩니다.
쓰기 가능
workingLocationProperties nested object 근무 위치 이벤트 데이터 쓰기 가능
workingLocationProperties.customLocation object 있는 경우 사용자가 맞춤 위치에서 근무하고 있음을 지정합니다. 쓰기 가능
workingLocationProperties.customLocation.label string 추가 정보를 위한 추가 라벨(선택사항)입니다. 쓰기 가능
workingLocationProperties.homeOffice any value 있는 경우 사용자가 재택근무 중임을 지정합니다. 쓰기 가능
workingLocationProperties.officeLocation object 있는 경우 사용자가 사무실에서 근무 중임을 지정합니다. 쓰기 가능
workingLocationProperties.officeLocation.buildingId string 건물 식별자(선택사항)입니다. 조직의 리소스 데이터베이스에 있는 건물 ID를 참조해야 합니다. 쓰기 가능
workingLocationProperties.officeLocation.deskId string 데스크 식별자(선택사항)입니다. 쓰기 가능
workingLocationProperties.officeLocation.floorId string 층 식별자(선택사항)입니다. 쓰기 가능
workingLocationProperties.officeLocation.floorSectionId string 층 섹션 식별자(선택사항)입니다. 쓰기 가능
workingLocationProperties.officeLocation.label string Calendar 웹 및 모바일 클라이언트에 표시되는 사무실 이름입니다. 조직의 리소스 데이터베이스에서 건물 이름을 참조하는 것이 좋습니다. 쓰기 가능
workingLocationProperties.type string 근무 위치의 유형입니다. 가능한 값은 다음과 같습니다.
  • 'homeOffice': 사용자가 재택근무 중입니다.
  • 'officeLocation': 사용자가 사무실에서 근무하고 있습니다.
  • 'customLocation': 사용자가 맞춤 위치에서 근무 중입니다.
세부정보는 지정된 이름의 하위 입력란에 지정되지만, 비어 있으면 이 입력란이 누락될 수 있습니다. 다른 필드는 무시됩니다.

근무 위치 속성을 추가할 때 필요합니다.

쓰기 가능

응답

요청에 성공할 경우 이 메서드는 응답 본문에 이벤트 리소스를 반환합니다.

참고: 이 메서드에 제공되는 코드 예시가 지원되는 모든 프로그래밍 언어를 나타내는 것은 아닙니다. 지원되는 언어 목록은 클라이언트 라이브러리 페이지를 참조하세요.

Java

자바 클라이언트 라이브러리를 사용합니다.

// Refer to the Java quickstart on how to setup the environment:
// https://developers.google.com/calendar/quickstart/java
// Change the scope to CalendarScopes.CALENDAR and delete any stored
// credentials.

Event event = new Event()
    .setSummary("Google I/O 2015")
    .setLocation("800 Howard St., San Francisco, CA 94103")
    .setDescription("A chance to hear more about Google's developer products.");

DateTime startDateTime = new DateTime("2015-05-28T09:00:00-07:00");
EventDateTime start = new EventDateTime()
    .setDateTime(startDateTime)
    .setTimeZone("America/Los_Angeles");
event.setStart(start);

DateTime endDateTime = new DateTime("2015-05-28T17:00:00-07:00");
EventDateTime end = new EventDateTime()
    .setDateTime(endDateTime)
    .setTimeZone("America/Los_Angeles");
event.setEnd(end);

String[] recurrence = new String[] {"RRULE:FREQ=DAILY;COUNT=2"};
event.setRecurrence(Arrays.asList(recurrence));

EventAttendee[] attendees = new EventAttendee[] {
    new EventAttendee().setEmail("lpage@example.com"),
    new EventAttendee().setEmail("sbrin@example.com"),
};
event.setAttendees(Arrays.asList(attendees));

EventReminder[] reminderOverrides = new EventReminder[] {
    new EventReminder().setMethod("email").setMinutes(24 * 60),
    new EventReminder().setMethod("popup").setMinutes(10),
};
Event.Reminders reminders = new Event.Reminders()
    .setUseDefault(false)
    .setOverrides(Arrays.asList(reminderOverrides));
event.setReminders(reminders);

String calendarId = "primary";
event = service.events().insert(calendarId, event).execute();
System.out.printf("Event created: %s\n", event.getHtmlLink());

Python

Python 클라이언트 라이브러리를 사용합니다.

# Refer to the Python quickstart on how to setup the environment:
# https://developers.google.com/calendar/quickstart/python
# Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any
# stored credentials.

event = {
  'summary': 'Google I/O 2015',
  'location': '800 Howard St., San Francisco, CA 94103',
  'description': 'A chance to hear more about Google\'s developer products.',
  'start': {
    'dateTime': '2015-05-28T09:00:00-07:00',
    'timeZone': 'America/Los_Angeles',
  },
  'end': {
    'dateTime': '2015-05-28T17:00:00-07:00',
    'timeZone': 'America/Los_Angeles',
  },
  'recurrence': [
    'RRULE:FREQ=DAILY;COUNT=2'
  ],
  'attendees': [
    {'email': 'lpage@example.com'},
    {'email': 'sbrin@example.com'},
  ],
  'reminders': {
    'useDefault': False,
    'overrides': [
      {'method': 'email', 'minutes': 24 * 60},
      {'method': 'popup', 'minutes': 10},
    ],
  },
}

event = service.events().insert(calendarId='primary', body=event).execute()
print 'Event created: %s' % (event.get('htmlLink'))

2,399필리핀

PHP 클라이언트 라이브러리를 사용합니다.

// Refer to the PHP quickstart on how to setup the environment:
// https://developers.google.com/calendar/quickstart/php
// Change the scope to Google_Service_Calendar::CALENDAR and delete any stored
// credentials.

$event = new Google_Service_Calendar_Event(array(
  'summary' => 'Google I/O 2015',
  'location' => '800 Howard St., San Francisco, CA 94103',
  'description' => 'A chance to hear more about Google\'s developer products.',
  'start' => array(
    'dateTime' => '2015-05-28T09:00:00-07:00',
    'timeZone' => 'America/Los_Angeles',
  ),
  'end' => array(
    'dateTime' => '2015-05-28T17:00:00-07:00',
    'timeZone' => 'America/Los_Angeles',
  ),
  'recurrence' => array(
    'RRULE:FREQ=DAILY;COUNT=2'
  ),
  'attendees' => array(
    array('email' => 'lpage@example.com'),
    array('email' => 'sbrin@example.com'),
  ),
  'reminders' => array(
    'useDefault' => FALSE,
    'overrides' => array(
      array('method' => 'email', 'minutes' => 24 * 60),
      array('method' => 'popup', 'minutes' => 10),
    ),
  ),
));

$calendarId = 'primary';
$event = $service->events->insert($calendarId, $event);
printf('Event created: %s\n', $event->htmlLink);

Ruby

Ruby 클라이언트 라이브러리 사용

event = Google::Apis::CalendarV3::Event.new(
  summary: 'Google I/O 2015',
  location: '800 Howard St., San Francisco, CA 94103',
  description: 'A chance to hear more about Google\'s developer products.',
  start: Google::Apis::CalendarV3::EventDateTime.new(
    date_time: '2015-05-28T09:00:00-07:00',
    time_zone: 'America/Los_Angeles'
  ),
  end: Google::Apis::CalendarV3::EventDateTime.new(
    date_time: '2015-05-28T17:00:00-07:00',
    time_zone: 'America/Los_Angeles'
  ),
  recurrence: [
    'RRULE:FREQ=DAILY;COUNT=2'
  ],
  attendees: [
    Google::Apis::CalendarV3::EventAttendee.new(
      email: 'lpage@example.com'
    ),
    Google::Apis::CalendarV3::EventAttendee.new(
      email: 'sbrin@example.com'
    )
  ],
  reminders: Google::Apis::CalendarV3::Event::Reminders.new(
    use_default: false,
    overrides: [
      Google::Apis::CalendarV3::EventReminder.new(
        reminder_method: 'email',
        minutes: 24 * 60
      ),
      Google::Apis::CalendarV3::EventReminder.new(
        reminder_method: 'popup',
        minutes: 10
      )
    ]
  )
)

result = client.insert_event('primary', event)
puts "Event created: #{result.html_link}"

.NET

.NET 클라이언트 라이브러리를 사용합니다.

// Refer to the .NET quickstart on how to setup the environment:
// https://developers.google.com/calendar/quickstart/dotnet
// Change the scope to CalendarService.Scope.Calendar and delete any stored
// credentials.

Event newEvent = new Event()
{
    Summary = "Google I/O 2015",
    Location = "800 Howard St., San Francisco, CA 94103",
    Description = "A chance to hear more about Google's developer products.",
    Start = new EventDateTime()
    {
        DateTime = DateTime.Parse("2015-05-28T09:00:00-07:00"),
        TimeZone = "America/Los_Angeles",
    },
    End = new EventDateTime()
    {
        DateTime = DateTime.Parse("2015-05-28T17:00:00-07:00"),
        TimeZone = "America/Los_Angeles",
    },
    Recurrence = new String[] { "RRULE:FREQ=DAILY;COUNT=2" },
    Attendees = new EventAttendee[] {
        new EventAttendee() { Email = "lpage@example.com" },
        new EventAttendee() { Email = "sbrin@example.com" },
    },
    Reminders = new Event.RemindersData()
    {
        UseDefault = false,
        Overrides = new EventReminder[] {
            new EventReminder() { Method = "email", Minutes = 24 * 60 },
            new EventReminder() { Method = "sms", Minutes = 10 },
        }
    }
};

String calendarId = "primary";
EventsResource.InsertRequest request = service.Events.Insert(newEvent, calendarId);
Event createdEvent = request.Execute();
Console.WriteLine("Event created: {0}", createdEvent.HtmlLink);

Go

Go 클라이언트 라이브러리를 사용합니다.

// Refer to the Go quickstart on how to setup the environment:
// https://developers.google.com/calendar/quickstart/go
// Change the scope to calendar.CalendarScope and delete any stored credentials.

event := &calendar.Event{
  Summary: "Google I/O 2015",
  Location: "800 Howard St., San Francisco, CA 94103",
  Description: "A chance to hear more about Google's developer products.",
  Start: &calendar.EventDateTime{
    DateTime: "2015-05-28T09:00:00-07:00",
    TimeZone: "America/Los_Angeles",
  },
  End: &calendar.EventDateTime{
    DateTime: "2015-05-28T17:00:00-07:00",
    TimeZone: "America/Los_Angeles",
  },
  Recurrence: []string{"RRULE:FREQ=DAILY;COUNT=2"},
  Attendees: []*calendar.EventAttendee{
    &calendar.EventAttendee{Email:"lpage@example.com"},
    &calendar.EventAttendee{Email:"sbrin@example.com"},
  },
}

calendarId := "primary"
event, err = srv.Events.Insert(calendarId, event).Do()
if err != nil {
  log.Fatalf("Unable to create event. %v\n", err)
}
fmt.Printf("Event created: %s\n", event.HtmlLink)

JavaScript

JavaScript 클라이언트 라이브러리를 사용합니다.

// Refer to the JavaScript quickstart on how to setup the environment:
// https://developers.google.com/calendar/quickstart/js
// Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any
// stored credentials.

var event = {
  'summary': 'Google I/O 2015',
  'location': '800 Howard St., San Francisco, CA 94103',
  'description': 'A chance to hear more about Google\'s developer products.',
  'start': {
    'dateTime': '2015-05-28T09:00:00-07:00',
    'timeZone': 'America/Los_Angeles'
  },
  'end': {
    'dateTime': '2015-05-28T17:00:00-07:00',
    'timeZone': 'America/Los_Angeles'
  },
  'recurrence': [
    'RRULE:FREQ=DAILY;COUNT=2'
  ],
  'attendees': [
    {'email': 'lpage@example.com'},
    {'email': 'sbrin@example.com'}
  ],
  'reminders': {
    'useDefault': false,
    'overrides': [
      {'method': 'email', 'minutes': 24 * 60},
      {'method': 'popup', 'minutes': 10}
    ]
  }
};

var request = gapi.client.calendar.events.insert({
  'calendarId': 'primary',
  'resource': event
});

request.execute(function(event) {
  appendPre('Event created: ' + event.htmlLink);
});

Node.js

Node.js 클라이언트 라이브러리를 사용합니다.

// Refer to the Node.js quickstart on how to setup the environment:
// https://developers.google.com/calendar/quickstart/node
// Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any
// stored credentials.

var event = {
  'summary': 'Google I/O 2015',
  'location': '800 Howard St., San Francisco, CA 94103',
  'description': 'A chance to hear more about Google\'s developer products.',
  'start': {
    'dateTime': '2015-05-28T09:00:00-07:00',
    'timeZone': 'America/Los_Angeles',
  },
  'end': {
    'dateTime': '2015-05-28T17:00:00-07:00',
    'timeZone': 'America/Los_Angeles',
  },
  'recurrence': [
    'RRULE:FREQ=DAILY;COUNT=2'
  ],
  'attendees': [
    {'email': 'lpage@example.com'},
    {'email': 'sbrin@example.com'},
  ],
  'reminders': {
    'useDefault': false,
    'overrides': [
      {'method': 'email', 'minutes': 24 * 60},
      {'method': 'popup', 'minutes': 10},
    ],
  },
};

calendar.events.insert({
  auth: auth,
  calendarId: 'primary',
  resource: event,
}, function(err, event) {
  if (err) {
    console.log('There was an error contacting the Calendar service: ' + err);
    return;
  }
  console.log('Event created: %s', event.htmlLink);
});

사용해 보기

아래의 API 탐색기를 사용하여 실시간 데이터를 대상으로 이 메소드를 호출하고 응답을 확인해 보세요.