如何从Google GAIA ID中查找用户信息?

rfo*_*foo 12 php android json hangout

我一直在为Google的Takeout服务开发一个Hangouts.json解析器,它从json文件中获取所有对话,附件和杂项信息,并使用所有内容填充数据库.我已经完成了所有内容,但json文件提供的唯一信息是谁发送了我能够弄清楚的GAIA ID,这是Google在其服务之间使用的唯一ID.问题是我不知道如何查找有关用户的任何其他信息,例如他们识别的名称或他们的电子邮件.

我知道大部分信息都是公开的,因为您可以使用GAIA ID并将其放入以下URL:https://plus.google.com/u/0/#####################/about其中#是GAIA ID.此页面将公开显示其屏幕名称.当电子邮件地址未知时,可以通过以下方式推断出同样的事情:reply-#####################@profiles.google.com这也可以用来联系他们.

理想情况下,我希望能够查找用户的屏幕名称,而不必至少解析该公共Google+信息页,但真正的电子邮件也会很棒.理想情况下,我想要API或其他资源来查找GAIA ID中的屏幕名称和/或电子邮件信息.

Rob*_*bie 15

使用Google Plus API:https://developers.google.com/+/api/

我没有专门使用环聊进行测试(我从来不知道有一个Hongouts API!)但它会从其他API返回给定ID的详细信息.

您可以在此处进行测试:https://developers.google.com/apis-explorer/#p/plus/v1/plus.people.get,了解您将获得的内容.


Oli*_*ier 5

The Gaia ID may be obtained with the People API, by requesting the metadata in the personFields.

You may try it with the Google APIs Explorer (sample links are provided below).


For any of your contacts (provided he/she is a google user), using the people.connections/list resource :

People API - people.connections/list - personFields=names,metadata (I have included the names value in the personFields for better illustration, though it is not required to retrieve the Gaia Id)

Sample output (1XXXXXXXXXXXXXXXXXXXX is the Gaia Id):

{
  "connections": [
    {
      "resourceName": "people/c42",
      "etag": "...",
      "metadata": {
        "sources": [
          {
            "type": "CONTACT",
            ...
          },
          {
            "type": "PROFILE",
            "id": "1XXXXXXXXXXXXXXXXXXXX",
            ...
            "profileMetadata": {
              "objectType": "PERSON",
              "userTypes": [
                "GOOGLE_USER"
              ]
            }
          }
          ....
        ],
        "objectType": "PERSON"
      }
      "names": [
        {
          ...
          "displayName": "John Doe",
          ...
        }
      ]
    },
    ...
}
Run Code Online (Sandbox Code Playgroud)

For yourself or any user using the people/get resource

People API - people/get - personFields=metadata

In the resourceName field :

  • use people/me to obtain your informations.
  • use the resourceName value previously retrieved in a people.connections.list request to retrieve another user informations

Sample output (1XXXXXXXXXXXXXXXXXXXX is the Gaia Id):

{
  "resourceName": "people/...",
  "etag": "....",
  "metadata": {
    "sources": [
      {
        "type": "PROFILE",
        "id": "1XXXXXXXXXXXXXXXXXXXX",
        "etag": "...",
        "profileMetadata": {
          "objectType": "PERSON",
          "userTypes": [
            "GOOGLE_USER"
          ]
        }
        ...
      },
     ...
    ],
    "objectType": "PERSON"
  }
}
Run Code Online (Sandbox Code Playgroud)