處理會議

本指南說明如何透過 Google Meet REST API 的 conferenceRecords 資源,取得單一或所有會議的詳細資料。

會議是伺服器在會議空間中產生的通話例項。這也是單一會議例項。

如果您是會議空間擁有者或參與者,可以呼叫 get()list() 方法來擷取會議記錄。

透過使用者憑證進行驗證和授權後,Google Meet 應用程式就能存取使用者資料,並代表已通過驗證的使用者執行作業。使用全網域委派進行驗證,可授權應用程式的服務帳戶存取使用者資料,不必逐一取得使用者的同意。

取得會議詳細資料

如要取得特定會議的詳細資料,請使用 conferenceRecords 資源的 get() 方法,並提供會議 name 路徑參數。如果您不知道會議名稱,可以使用 list() 方法列出所有會議名稱

這個方法會以 conferenceRecords 資源的例項形式,傳回過往的會議。

下列程式碼範例說明如何擷取特定會議:

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/conferencerecordsservice/getconferencerecord/AsyncGetConferenceRecord.java
import com.google.api.core.ApiFuture; import com.google.apps.meet.v2.ConferenceRecord; import com.google.apps.meet.v2.ConferenceRecordName; import com.google.apps.meet.v2.ConferenceRecordsServiceClient; import com.google.apps.meet.v2.GetConferenceRecordRequest;  public class AsyncGetConferenceRecord {    public static void main(String[] args) throws Exception {     asyncGetConferenceRecord();   }    public static void asyncGetConferenceRecord() throws Exception {     // This snippet has been automatically generated and should be regarded as a code template only.     // It will require modifications to work:     // - It may require correct/in-range values for request initialization.     // - It may require specifying regional endpoints when creating the service client as shown in     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library     try (ConferenceRecordsServiceClient conferenceRecordsServiceClient =         ConferenceRecordsServiceClient.create()) {       GetConferenceRecordRequest request =           GetConferenceRecordRequest.newBuilder()               .setName(ConferenceRecordName.of("[CONFERENCE_RECORD]").toString())               .build();       ApiFuture<ConferenceRecord> future =           conferenceRecordsServiceClient.getConferenceRecordCallable().futureCall(request);       // Do something.       ConferenceRecord response = future.get();     }   } }

Node.js

packages/google-apps-meet/samples/generated/v2/conference_records_service.get_conference_record.js
/**  * This snippet has been automatically generated and should be regarded as a code template only.  * It will require modifications to work.  * It may require correct/in-range values for request initialization.  * TODO(developer): Uncomment these variables before running the sample.  */ /**  *  Required. Resource name of the conference.  */ // const name = 'abc123'  // Imports the Meet library const {ConferenceRecordsServiceClient} = require('@google-apps/meet').v2;  // Instantiates a client const meetClient = new ConferenceRecordsServiceClient();  async function callGetConferenceRecord() {   // Construct request   const request = {     name,   };    // Run request   const response = await meetClient.getConferenceRecord(request);   console.log(response); }  callGetConferenceRecord();

Python

packages/google-apps-meet/samples/generated_samples/meet_v2_generated_conference_records_service_get_conference_record_async.py
# This snippet has been automatically generated and should be regarded as a # code template only. # It will require modifications to work: # - It may require correct/in-range values for request initialization. # - It may require specifying regional endpoints when creating the service #   client as shown in: #   https://googleapis.dev/python/google-api-core/latest/client_options.html from google.apps import meet_v2   async def sample_get_conference_record():     # Create a client     client = meet_v2.ConferenceRecordsServiceAsyncClient()      # Initialize request argument(s)     request = meet_v2.GetConferenceRecordRequest(         name="name_value",     )      # Make the request     response = await client.get_conference_record(request=request)      # Handle the response     print(response)

將會議記錄名稱替換為會議記錄中的特定會議 ID 名稱。

列出所有會議

如要列出所有會議的詳細資料,請在 conferenceRecords 資源上使用 list() 方法,且不含任何路徑參數。

這個方法會以 conferenceRecords 資源的執行個體形式,傳回過往會議的清單。系統會篩選出會議發起人,並依 startTime 遞減順序排序。如要調整頁面大小及篩選查詢結果,請參閱自訂分頁或篩選清單

下列程式碼範例說明如何列出所有會議:

Java

java-meet/samples/snippets/generated/com/google/apps/meet/v2/conferencerecordsservice/listconferencerecords/AsyncListConferenceRecords.java
import com.google.api.core.ApiFuture; import com.google.apps.meet.v2.ConferenceRecord; import com.google.apps.meet.v2.ConferenceRecordsServiceClient; import com.google.apps.meet.v2.ListConferenceRecordsRequest;  public class AsyncListConferenceRecords {    public static void main(String[] args) throws Exception {     asyncListConferenceRecords();   }    public static void asyncListConferenceRecords() throws Exception {     // This snippet has been automatically generated and should be regarded as a code template only.     // It will require modifications to work:     // - It may require correct/in-range values for request initialization.     // - It may require specifying regional endpoints when creating the service client as shown in     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library     try (ConferenceRecordsServiceClient conferenceRecordsServiceClient =         ConferenceRecordsServiceClient.create()) {       ListConferenceRecordsRequest request =           ListConferenceRecordsRequest.newBuilder()               .setPageSize(883849137)               .setPageToken("pageToken873572522")               .setFilter("filter-1274492040")               .build();       ApiFuture<ConferenceRecord> future =           conferenceRecordsServiceClient.listConferenceRecordsPagedCallable().futureCall(request);       // Do something.       for (ConferenceRecord element : future.get().iterateAll()) {         // doThingsWith(element);       }     }   } }

Node.js

packages/google-apps-meet/samples/generated/v2/conference_records_service.list_conference_records.js
/**  * This snippet has been automatically generated and should be regarded as a code template only.  * It will require modifications to work.  * It may require correct/in-range values for request initialization.  * TODO(developer): Uncomment these variables before running the sample.  */ /**  *  Optional. Maximum number of conference records to return. The service might  *  return fewer than this value. If unspecified, at most 25 conference records  *  are returned. The maximum value is 100; values above 100 are coerced to  *  100. Maximum might change in the future.  */ // const pageSize = 1234 /**  *  Optional. Page token returned from previous List Call.  */ // const pageToken = 'abc123' /**  *  Optional. User specified filtering condition in EBNF  *  format (https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form).  *  The following are the filterable fields:  *  * `space.meeting_code`  *  * `space.name`  *  * `start_time`  *  * `end_time`  *  For example, consider the following filters:  *  * `space.name = "spaces/NAME"`  *  * `space.meeting_code = "abc-mnop-xyz"`  *  * `start_time>="2024-01-01T00:00:00.000Z" AND  *  start_time<="2024-01-02T00:00:00.000Z"`  *  * `end_time IS NULL`  */ // const filter = 'abc123'  // Imports the Meet library const {ConferenceRecordsServiceClient} = require('@google-apps/meet').v2;  // Instantiates a client const meetClient = new ConferenceRecordsServiceClient();  async function callListConferenceRecords() {   // Construct request   const request = {   };    // Run request   const iterable = meetClient.listConferenceRecordsAsync(request);   for await (const response of iterable) {       console.log(response);   } }  callListConferenceRecords();

Python

packages/google-apps-meet/samples/generated_samples/meet_v2_generated_conference_records_service_list_conference_records_async.py
# This snippet has been automatically generated and should be regarded as a # code template only. # It will require modifications to work: # - It may require correct/in-range values for request initialization. # - It may require specifying regional endpoints when creating the service #   client as shown in: #   https://googleapis.dev/python/google-api-core/latest/client_options.html from google.apps import meet_v2   async def sample_list_conference_records():     # Create a client     client = meet_v2.ConferenceRecordsServiceAsyncClient()      # Initialize request argument(s)     request = meet_v2.ListConferenceRecordsRequest(     )      # Make the request     page_result = client.list_conference_records(request=request)      # Handle the response     async for response in page_result:         print(response)

自訂分頁或篩選清單

傳遞下列選用查詢參數,即可自訂會議記錄的分頁或篩選條件:

  • pageSize:要傳回的會議記錄數量上限。服務傳回的產品數量可能會少於這個值。如未指定,最多將傳回 25 筆會議記錄。最大值為 100;超過 100 的值會自動變更為 100。

  • pageToken:屬於接收自前一個清單呼叫的網頁權杖。提供此權杖即可擷取後續網頁。

  • filter:查詢篩選條件,用於擷取 conferenceRecords 資源結果中的特定項目。如需支援的查詢詳細資料,請參閱 list() 方法。如要進一步瞭解如何判斷會議空間,請參閱「Meet 如何識別會議空間」一文。