亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Google Calendar API:無法設置 AllowedConferenceSolution

Google Calendar API:無法設置 AllowedConferenceSolution

PHP
狐的傳說 2022-12-03 10:45:55
使用Google APIs Client Library for PHP,我正在嘗試創建一個新的日歷事件并附加一個hangoutsMeet會議。當我嘗試這樣做時,我收到一條錯誤消息,說明Invalid conference type value.使用相同的代碼,我能夠創建一個新事件并附加一個eventHangout會議。我明白為什么會收到錯誤消息:根據 API,我的日歷僅支持eventHangout會議類型。<<<< 2020 年 4 月 3 日編輯 #1Andres Duarte的回答后的澄清:這僅在我嘗試通過 API 創建事件時顯示為限制。當我使用 Google 日歷界面手動創建活動時,我可以添加 Google Meet。事實上,這是下拉列表中顯示的唯一會議選項。>>>>我的問題是,如何更新我的日歷設置(有或沒有 API)以便我可以使用 API 創建帶有附加hangoutsMeet會議的事件?這是一些示例代碼來演示我嘗試過的內容:<<<< 2020 年 4 月 3 日編輯 #2hooman182的回答后的澄清:我已經更新了我的代碼示例以證明我requestId使用字符串進行了正確設置。>>>>try {    // fetch the calendar    $calendar = 'myCalendar';    $calendarObject = $service->calendars->get($calendar);    echo "<pre>";    echo "\nORIGINAL *******************************************************\n\n";    var_dump($calendarObject->getConferenceProperties()->getAllowedConferenceSolutionTypes());    // set the allowed conferences solutions type    $calendarObject->getConferenceProperties()->setAllowedConferenceSolutionTypes(        array(            "hangoutsMeet",            "eventHangout",            "eventNamedHangout",        )    );    echo "\nUPDATED *******************************************************\n\n";    var_dump($calendarObject->getConferenceProperties()->getAllowedConferenceSolutionTypes());    // save the changes to the calendar    $calendarObject = $service->calendars->patch($calendar, $calendarObject);;    echo "\nSAVED *********************************************************\n\n";    var_dump($calendarObject->getConferenceProperties()->getAllowedConferenceSolutionTypes());    // add a createRequest to my event    $event->setConferenceData(new Google_Service_Calendar_ConferenceData(array(        'createRequest' => array(            'requestId' => md5(time()),            'conferenceSolutionKey' => array(                'type' => 'hangoutsMeet',            )        )    )));
查看完整描述

2 回答

?
互換的青春

TA貢獻1797條經驗 獲得超6個贊

在創建活動之前,您需要使用服務帳戶憑據模擬您 G Suite 域中的用戶,這樣您就可以創建hangoutsMeet會議類型的活動,這僅適用于 G Suite 用戶。

即使您的服務帳戶具有域范圍的委派,它也沒有與 G Suite 用戶相同的權限,來自文檔

與用戶帳戶不同,服務帳戶不是您的 G Suite 域的成員。

在您的情況下,這就是為什么您只能使用會議類型創建事件,如事件資源eventHangout文檔中所述,會議類型適用于消費者:

可能的值是:

消費者環聊的“eventHangout”( http://hangouts.google.com )

“eventNamedHangout”適用于 G Suite 用戶的經典環聊 ( http://hangouts.google.com )

Hangouts Meet 的“hangoutsMeet” ( http://meet.google.com )

3P 會議提供商的“addOn”


查看完整回答
反對 回復 2022-12-03
?
泛舟湖上清波郎朗

TA貢獻1818條經驗 獲得超3個贊

Appereantly 你忘了在你的請求中添加 requestID。


資源 :為活動添加視頻和電話會議


 "conferenceData": {

    "createRequest": {

      "conferenceSolutionKey": {

        "type": "eventHangout"

      },

      "requestId": "yourcodehere"

    }

  }

您可以通過為createRequest提供新生成的requestId(可以是隨機字符串)來為事件創建新會議。會議是異步創建的,但您始終可以檢查請求的狀態,讓您的用戶知道發生了什么。


我希望這有幫助。


查看完整回答
反對 回復 2022-12-03
  • 2 回答
  • 0 關注
  • 137 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號