Getting Gmail contacts in php

I want to get the email IDs that are associated with this Gmail account. This should be done on the local server I use xampp serverin Windows 7.

I use the link below to get gmail contacts.

https://www.design19.org/blog/import-google-contacts-with-php-or-javascript-using-google-contacts-api-and-oauth-2-0/

Below I have done:

  • created project in google, and also activate contact api.

  • Paste client_idand client_secret_id.

  • google_redirect_uri ='http://localhost';

Problem

When I clicked the button import google contacts, he redirected me to the Google login page to select an account to log in, after the site to log in asks me Allow Contact sharesto do this? "

After clicking the "Allow" button, it redirects me to the default xampp index page http://localhost/dashboard/, because in the google app redirect URL I installed http://localhost.

I tried setting the redirect url to contact google api along the path of my files, but this did not allow me to use /, so I installed it: http://localhostinsteadhttp://localhost/contacts/index.php

So where can I see the answer I received from google contact api?

+4
source share
1 answer

Below you will find the following steps.

Step 1:

In your localhost application you need to set the redirect URL as http://localhost/contacts/index.php

Step 2:

Google http://localhost/contacts/index.php URL- .

.

, URL- localhost Google , .

, .

+4

Source: https://habr.com/ru/post/1682310/


All Articles