0
Google 캘린더와 상호 작용하는 앱을 만들고 리소스를보고 싶지만 시청을 중지 할 수도 있습니다. 내가 않은 시계에 때Google 캘린더 API - 이벤트보기 중지
나는 나 자신을 인증하는 서비스 계정과의 OAuth 2.0을 사용하여 절대적 그래서 내가있는 권한 알고 찾을 작업 다른 API 호출을하고 Error calling POST https://www.googleapis.com/calendar/v3/channels/stop: (403) Incorrect OAuth client
오류를 얻을. 내가 도대체 뭘 잘못하고있는 겁니까?
이러한 작업 API 호출의 일부가된다 ...
public function getEvents($calendarId, $opts = array())
{
$events = $this->calendarService->events->listEvents($calendarId, $opts);
return $events;
}
public function getEvent($calendarId, $eventId)
{
$event = $this->calendarService->events->get($calendarId, $eventId);
return $event;
}
public function watch($calendarId, $channelId, $listener)
{
$channel = new Google_Service_Calendar_Channel($this->client);
$channel->setId($channelId);
$channel->setType('web_hook');
$channel->setAddress($listener);
$watchEvent = $this->calendarService->events->watch($calendarId, $channel, array());
return $watchEvent;
}
이것은 정지 API 호출 ...
public function stopWatch($channelId, $resourceId)
{
$channel = new Google_Service_Calendar_Channel($this->client);
$channel->setId($channelId);
$channel->setResourceId($resourceId);
$watchEvent = $this->calendarService->channels->stop($channel);
return $watchEvent;
}
이 작업을하는 방법에 어떤 아이디어가?