Smith
Smith

Reputation: 31

How to find the date a user created their Google account

I referer this link Login with Google using PHP API library and other tutorial and implement Google Login API in my script.

Once the user has logged in I am looking for how to get the data about when their Google account was created. I havent been able to find this information in the current login data returned by the oauth server.

Upvotes: 2

Views: 19908

Answers (2)

Noah
Noah

Reputation: 1046

Well I think tis is only for Google drive, which so far as I know didn't exist when gmail was created. My gmail account was created in like 2000 when gmail was still in beta, but that API gives me 2008.

Upvotes: 0

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117301

This is a really good question. To start i know a lot of the Google APIs so I started digging. I did check a number of the gmail api end points there was nothing interesting their in my opinion.

Oauth2 profile

My first thought was to try the oauth2 playground and see if this information was returned by a profile call

https://developers.google.com/oauthplayground

It was note. That would have been to easy

People API

Then I thought i would try was people.get

https://people.googleapis.com/v1/people/me

There is a lot of information here but not about what day i created my account.

Calendar

This lead me to think that a calendar is also created the primary calendar in google calendar when you create your account calendar.get

https://www.googleapis.com/calendar/v3/calendars/primary

This didnt work either there is no create date.

Drive

Then I remembered that your root drive in Google drive is also created when you create your account. try this

GET https://www.googleapis.com/drive/v3/files/root?fields=*&key={YOUR_API_KEY}

"createdTime": "2009-01-30T15:52:51.516Z",

Answer: the only way i can see currently to find out when a user created their google account is to check the createdtime on the root directory in Google Drive. That being said i would have thought my account was older than that but i am still looking.

Upvotes: 4

Related Questions