API Google Calendar insert ACL

48 Views Asked by At

I use the google-api-php-client to interact with the Google API in my saas app to create a calendar.

I have already successfully integrated authentication with token refresh, calendar creation, creation/deletion and updating of events.

I am now trying to share the calendar with other users this way (following the example in the api doc)

$scope = new AclRuleScope();
$scope->setType('user');
$scope->setValue('[email protected]');

$rule = new AclRule();
$rule->setScope($scope);
$rule->setRole('reader');

$result = $this->acl->insert('my-google-calendar-id', $rule);

and the response of the call to insert is

                              
  {                           
   "error": {                 
    "errors": [               
     {                        
      "domain": "global",     
      "reason": "notFound",   
      "message": "Not Found"  
     }                        
    ],                        
    "code": 404,              
    "message": "Not Found"    
   }                          
  }                           
                              

I ran the insert in the google developers console and it worked correctly. I checked that 'google-calendar-id' exists with a get method. I also set up a retries system with a sleep but without success, I still have the same error. The scopes used for authorizations are Calendar::CALENDAR, Calendar::CALENDAR_EVENTS

Has anyone ever had this problem ? What am I doing wrong ?

0

There are 0 best solutions below