【问题标题】:Fetch Gmail contacts in php在 php 中获取 Gmail 联系人
【发布时间】:2018-01-01 16:58:01
【问题描述】:

我想获取与给定 gmail 帐户关联的电子邮件 ID。这应该在本地服务器上完成,我在Windows 7 上使用xampp server

我正在使用以下链接获取 gmail 联系人。

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

我已完成以下步骤:

  1. 在 google 上创建项目并激活联系人 api。

  2. 粘贴client_idclient_secret_id

  3. google_redirect_uri ='http://localhost';

问题

当我点击import google contacts 按钮时,它会将我重定向到谷歌的登录页面以选择登录帐户,登录网站后要求我到Allow Contact shares 执行此操作?"

点击允许按钮后,它会将我重定向到 xampp 的默认索引页面 http://localhost/dashboard/,因为在谷歌应用程序的重定向 url 中我设置了 http://localhost

我尝试根据我的文件程序路径将重定向 url 设置为联系 google 的 api,但它不允许我使用 / 所以我将其设置为 :http://localhost 代替 http://localhost/contacts/index.php

那么我在哪里可以看到我从 google contact api 得到的响应?

【问题讨论】:

    标签: php google-contacts-api google-content-api


    【解决方案1】:

    请找到下面提到的步骤。

    第 1 步:

    在您的 localhost 应用程序中,您需要将重定向 URL 设置为 http://localhost/contacts/index.php

    第 2 步:

    在您的 Google 应用中,您需要在 Authorizes Redirect URL 中添加http://localhost/contacts/index.php

    更改此设置后,您就可以在特定页面上进行重定向。

    确保您在 localhost 客户端调用和 Google App 中的重定向 URL 都需要相同,否则您将面临错误。

    如果它不起作用,请告诉我。

    【讨论】:

    • @AMITJOSHI:很高兴为您提供帮助
    猜你喜欢
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    • 2016-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-21
    相关资源
    最近更新 更多