Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google People API cannot get birthday year

this is my first question in stackoverflow. I have a problem with Google People API when I'm trying to get user birthday year. Here's the log from my logcat.

D/FitPartners: {"date":{"day":20,"month":1},"metadata":{"primary":true,"source":{"id":"1....41","type":"PROFILE"}}}

As you can see, I can get the month and day just fine. But, there's no year in there. Even when I'm using google Try it! from https://developers.google.com/people/api/rest/v1/people/get. The response don't give the year too.

Response

200 OK

- Show headers -

{
 "resourceName": "people/1.......41",
 "etag": "r....a4o=",
 "birthdays": [
  {
   "metadata": {
    "primary": true,
    "source": {
     "type": "PROFILE",
     "id": "1........41"
    }
   },
   "date": {
    "month": 1,
    "day": 20
   }
  }
 ]
}

I've been trying to figure out about this and searching from stackoverflow for 4 days before deciding to make a questions. Please help.

like image 545
Tommy Hart'no Avatar asked Oct 01 '16 09:10

Tommy Hart'no


1 Answers

If you want to verify the person's age, perhaps see if the age range field meets your needs. You can get it by requesting the https://www.googleapis.com/auth/profile.agerange.read scope.

like image 173
Amos Yuen Avatar answered Dec 25 '22 22:12

Amos Yuen