I have superadmin access to a domain, and I would like to create calendar resources using Google Apps Script.
Normally we can create calendar resources in Google admin console with admin access (https://accounts.google.com)...But but I want to automate it. I checked this page (https://developers.google.com/admin-sdk/directory/v1/reference/resources/calendars/insert).. and adapted it to a script, below, but I'm getting a "Bad Request" error.
What is wrong here?
This is my code--
function myFunction() {
var cus = 'email id';
var res ={
resource : 'Name of the resource',
resourceDescription : "Meeting Room",
resourceType : "Room"
}
AdminDirectory.Resources.Calendars.insert(res, cus);
}`