如何指定Google API的范围以获取生日

Ami*_*uli 11 google-api symfony google-plus google-oauth hwioauthbundle

我试图birthday从Google API获取,但检索到的数据HWIOAuthBundle不包含它.

我想知道google plus apiconfig.yml中的指定范围是否正确!

如果没有,请提供链接或更正的范围.

google:
    type:                google
    client_id:           %client_id%
    client_secret:       %secret_id%
    scope:               "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
    paths:
        email:           email
        profilepicture:  picture
Run Code Online (Sandbox Code Playgroud)

DaI*_*mTo 17

我刚刚使用Try It来测试.我用所有不同的范围测试了它.

https://www.googleapis.com/auth/plus.login了解您圈子中的基本个人资料信息和人员列表.

https://www.googleapis.com/auth/plus.me了解您在Google上的身份 https://www.googleapis.com/auth/userinfo.email查看您的电子邮件地址 https://www.googleapis.com/ auth/userinfo.profile查看有关您帐户的基本信息

在所有范围内回到生日并不重要.但重要的是必须public在帐户中设置用户生日.如果它被设置为其他任何东西,你的圈子,只有你,它没有列出.即使您尝试查看自己的信息,这似乎也是如此.(送我.)

更新,年份是2018年

People api现在返回当前用户的生日

People.get然而我怀疑它链接到谷歌+所以如果用户没有填写它你可能不会得到信息.

获取https://people.googleapis.com/v1/ {resourceName = people/*}

发送Resournce名称people/me 和生日personFields

{
  "resourceName": "people/117200475532672775346",
  "etag": "%EgQBBzcuGgwBAgMEBQYHCAkKCwwiDDQwaGhWYzc3cXJBPQ==",
  "birthdays": [
    {
      "metadata": {
        "primary": true,
        "source": {
          "type": "PROFILE",
          "id": "117200475532672775346"
        }
      },
      "date": {
        "month": 1,
        "day": 6
      }
    },
    {
      "metadata": {
        "source": {
          "type": "ACCOUNT",
          "id": "117200475532672775346"
        }
      },
      "date": {
        "year": 1971,
        "month": 1,
        "day": 6
      }
    }
  ]
Run Code Online (Sandbox Code Playgroud)