【问题标题】:Google people api, how access to field FileASGoogle people api,如何访问字段 FileAS
【发布时间】:2020-05-06 10:21:32
【问题描述】:

在显示更多下方的 Google 通讯录中,有字段文件为。我怎样才能得到它?

我有一个只有公司名称的联系人。所以不会提供人名。但是我将 File As 设置为与 company 不同。但我没找到。

【问题讨论】:

    标签: google-people-api


    【解决方案1】:

    People API 目前不支持“File As”属性。列出了唯一受支持的字段here

    请随时在此处提交功能请求:https://developers.google.com/people/support#missing_features

    【讨论】:

      【解决方案2】:

      自 2020 年 6 月起,这已由 Google 实施。见https://issuetracker.google.com/issues/155947710 但是 API 文档没有更新。您需要请求“fileAses”属性。 PHP 中的示例:

      // Retrieve the first 20 results from the database
      $optParams = array(
          'pageSize' => 20,
          'personFields' => 'names,fileAses',
      );
      $results = $service->people_connections->listPeopleConnections('people/me', $optParams);
      foreach ($results->getConnections() as $person) {
         $names = $person->getNames();
         $fileAs = $person->getFileAses();
         if ($fileAs) {
             $fileAsValue = $fileAs[0]->getValue();
         }
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-07-24
        • 1970-01-01
        • 2017-06-09
        • 2018-01-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-01-09
        相关资源
        最近更新 更多