【问题标题】:Get the list meetings from google hangouts meet从 google hangouts meet 获取列表会议
【发布时间】:2020-04-16 21:49:54
【问题描述】:

我在问是否可以检索使用 Java 中的 Google Hangout Meet API 完成的会议列表? 谷歌搜索后,我无法弄清楚。

更新 - 1: 使用 Google 日历,我做到了:

        Calendar service = getCalendarService();
        List<Event> items = new ArrayList<Event>();
        String pageToken = null;
        do {
          Events events = service.events().list("service-account-esprit@my-first-project-2587777.iam.gserviceaccount.com").setPageToken(pageToken).execute();
          items = events.getItems();
          for (Event event : items) {
            System.out.println(event.getSummary());
          }
          pageToken = events.getNextPageToken();
        } while (pageToken != null);

getCredentials()方法是:

public static Credential getCredentials() throws IOException
{
    java.io.File clientSecretFilePath = new java.io.File(CREDENTIALS_FOLDER, CLIENT_SECRET_FILE_NAME);

    InputStream in = new FileInputStream(clientSecretFilePath);
    GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));

    SCOPES.add(CalendarScopes.CALENDAR_READONLY);

    GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES).setDataStoreFactory(DATA_STORE_FACTORY).setAccessType("offline").build();
    Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");

    return credential;
}

更新 - 2

所以,我错过了启用 G Suite 域范围委派。 我修复了that capture 提出的问题 我将旧的 credentials.json 替换为 my-first-project-274515-ba944be8b749.json(创建服务帐户后生成的文件)。

然后,我发了Events events = service.events().list("service-account-esprit@my-first-project-2587777.iam.gserviceaccount.com").setPageToken(pageToken).execute();

我与 service-account-esprit@my-first-project-2587777.iam.gserviceaccount.com

共享日历

我也启用了 Google 日历 API。

但我得到了那个例外:

线程“主”java.lang.IllegalArgumentException 中的异常 com.google.api.client.repackaged.com.google.common.base.Preconditions.checkArgument(Preconditions.java:108) 在 com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:37) 在 com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.getDetails(GoogleClientSecrets.java:82) 在 com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow$Builder.(GoogleAuthorizationCodeFlow.java:197) 在 tn.esprit.spring.google.calendar.Calendar_Utils.getCredentials(Calendar_Utils.java:75) 在 tn.esprit.spring.google.calendar.Calendar_Utils.getCalendarService(Calendar_Utils.java:87) 在 tn.esprit.spring.google.calendar.Calendar_Utils.main(Calendar_Utils.java:95)

--> GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES).setDataStoreFactory(DATA_STORE_FACTORY).setAccessType("offline").build(); 出现错误 我想不通。 你能告诉我我错过了什么吗? 任何建议表示赞赏。 非常感谢。

【问题讨论】:

  • 您是指通过日历活动创建的环聊活动吗?
  • 您好@ziganotschka 先生,非常感谢您的回复。我的意思是每次会议都使用 Google Meet API 完成。但谷歌搜索后,我知道没有开放的 Meet API。那么,您能告诉我如何检索已完成的会议列表吗?可以使用 Hangout 检索该列表?再次感谢先生。
  • 现在只有在您的会议是作为日历事件的一部分创建的情况下才有可能。 Hangouts API 仅列出聊天室,这与会议不同。
  • 非常感谢先生的回复。我尝试使用 Google Calendar API 检索所有事件。我可以用我自己的 gmail 帐户做到这一点。但是我未能检索到域中的所有事件(entreprise.tn:其中包含很多 gmail 帐户)。先生,您能否告诉我我错过了什么,因为它与 Google Classroom API 一样好用。非常感谢。
  • 您可以发布您的 gmail 帐户代码吗?

标签: hangouts-api google-hangouts


【解决方案1】:

你可以试试:

Events events = service.events().list(user@entreprise.tn)
                .setOrderBy("startTime")
                .setSingleEvents(true)
                .execute();

HTH。

【讨论】:

    猜你喜欢
    • 2017-12-28
    • 2016-06-10
    • 1970-01-01
    • 2020-11-04
    • 2021-02-23
    • 1970-01-01
    • 2023-03-04
    • 2020-12-20
    • 1970-01-01
    相关资源
    最近更新 更多