php - move event from myservice account to my regular account error occur NOT FOUNND -


whenever try move event myservice account regular account problem occur not founnd,everything ok ,event id, calendar id, destination id, move google interface google move, code says not found, i tried move(last line) after inserting event

  require 'src/google/autoload.php';   require_once 'src/google/client.php';   require_once 'src/google/service/calendar.php';    $email_address = 'stafftesting@stafftesting-1204.iam.gserviceaccount.com';    $key_file_location = 'stafftesting-546f9e1a6522.p12';    $client = new google_client();   $client->setapplicationname("google calendar api php quickstart");   $key = file_get_contents($key_file_location);   $scopes = "https://www.googleapis.com/auth/calendar"; $cred = new google_auth_assertioncredentials( $email_address, array($scopes), $key);      $client->setassertioncredentials($cred);    if ($client->getauth()->isaccesstokenexpired()) {     $client->getauth()->refreshtokenwithassertion($cred);     }     $service = new google_service_calendar($client);    $event = new google_service_calendar_event(array(   'summary' => 'sushildai event',   'location' => '800 howard st., san francisco, ca 94103',    'start' => array(    'datetime' => '2016-01-30t09:00:00-07:00',   'timezone' => 'america/los_angeles', ),     'end' => array(    'datetime' => '2016-01-30t11:00:00-07:00',    'timezone' => 'america/los_angeles',     ),     'attendees' => array(    array('email' => 'lpage@unifun.com'),    array('email' => 'sbrin@unifun.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);  $result = $service->events->move('primary',$event->id,'soorazk@gmail.com');               printf('event created: %s\n', $event->htmllink);   $service->events->move('primary',$event->id, 'soorazkun1@gmail.com'); 

based on official google documentation, '4*04 not found'* happen in several cases. here examples: * when requested resource (with provided id) has never existed. * when accessing calendar user can not access.

when encountering '404 not found' error message, suggested action use 'exponential backoff'. google drive api documentation has explanation of exponential backoff , how use google apis. exponential backoff standard error handling strategy network applications in client periodically retries failed request on increasing amount of time.

here's useful google documentation on handling api errors , how implement exponential backoff:https://developers.google.com/google-apps/calendar/v3/errors


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -