PHP Google แทรก API เหตุการณ์ในปฏิทิน
ฉันใช้แพ็คเกจนี้: https://github.com/googleapis/google-api-php-client
$google_service = new Google_Service_Calendar($google_client);
$event = new Google_Service_Calendar_Event(array(....)); // Insert Calendar event $event = $google_service->events->insert($calendarId, $event); p($event);
$meet_link = $event->conferenceData->entryPoints[0]->uri;
ฉันเคยได้รับ$meet_linkแบบนี้จาก API แต่ทันใดนั้นมันก็เริ่มเกิดข้อผิดพลาด
trying to get property 'entryPoints' of non-object"
แทรกกิจกรรมในปฏิทิน Infact เรียบร้อยแล้ว แต่ฉันไม่ได้รับการ$event->conferenceData->entryPoints[0]->uriตอบสนอง Infact ฉันไม่ได้รับจุดเข้าใช้งานนี้object($event->conferenceData->entryPoints)
คำตอบ
ดูเหมือนว่าจะมีปัญหากับ conferenceData ที่ส่งคืนเมื่อสร้างเหตุการณ์ด้วย API
คุณสามารถคลิกที่ดาวข้างหมายเลขปัญหาเพื่อรับข้อมูลอัปเดตและให้ความสำคัญกับรายงานมากขึ้น
ในที่สุดก็พบทางออก. ส่วนการร้องขอจำเป็นต้องเปลี่ยนแปลง
สำหรับ PHP API
ฉันส่งผ่านข้อมูลการประชุมตามคำขอ
"conferenceData" => [
"createRequest" => [
"conferenceSolutionKey" => [
"type" => "hangoutsMeet"
],
"requestId" => "123"
]
],
$google_service->events->insert($calendarId, $event,['conferenceDataVersion' => 1]);
และส่งผ่านพารามิเตอร์ที่ 3 เป็นการตั้งค่า ['conferenceDataVersion' => 1] จากนั้นลิงก์การประชุมที่ส่งคืนเพื่อให้ทำงานได้ในขณะนี้