0

I'm trying to create an event in Google Calendar from Google Apps Script. When I run the following line

var event = CalendarApp.getDefaultCalendar().createEvent('Apollo 11 
Landing',
new Date('February 22, 2017 13:00:00 UTC'),
new Date('February 22, 2017 14:00:00 UTC'));

I'm getting 'You do not have permission to call createEvent'.

Any help would be appreciated

1 Answers1

0

Your code is working perfectly on Apps Script as I tested it:

function creatCalEvent(){
     var event = CalendarApp.getDefaultCalendar().createEvent('Apollo 11 Landing',new Date('February 29, 2018 13:00:00 UTC'),  new Date('February 30, 2018 14:00:00 UTC')); 
}

I don't know where you even put the 'googleapis.com/auth/calendar' scope as I didn't need to do anything like that. Just make sure you're logged into your account.

Screenshot:

enter image description here

Chris
  • 2,057
  • 1
  • 15
  • 25
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56