如何使用codebird.php检索Twitter用户电子邮件 [英] how to retrieve twitter user email using codebird.php

查看:133
本文介绍了如何使用codebird.php检索Twitter用户电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以使用

Is there a way I can request twitter user email address, avartarURL using codebird.php

当前,我仅获得屏幕名称.

Currently, I only get the screen name.

我正在做的是:

$reply = $this->client->oauth_requestToken(array('oauth_callback' => $this->clientCallback));

我当前正在关注的教程:

The tutorial I am currently following:

PartFour 这将使您了解什么从头5分钟开始.

PartFour This will give you a sense of what is going on from the first 5 min.

推荐答案

您可以通过调用account/verify_credentials Twitter API方法,将可选的include_email参数设置为1:

You can request a user’s email address by calling the account/verify_credentials Twitter API method, setting the optional include_email parameter to 1:

$reply = $cb->account_verifyCredentials([
  'include_email' => 1
]);
print_r($reply);

这仅适用于可以选择从启用的用户请求电子邮件地址的Twitter应用.

This will only work for Twitter apps that have the option to request email addresses from users enabled.

oauth/author 对话框通知用户您的应用可以访问其电子邮件地址.

The "Request email addresses from users" checkbox is available under the app permissions on developer.twitter.com. Privacy Policy URL and Terms of Service URL fields must be completed in the app settings in order for email address access to function. If enabled, users will be informed via the oauth/authorize dialog that your app can access their email address.

请注意-您的应用将需要重新生成用户访问令牌,以供先前通过身份验证的用户访问其电子邮件地址.

Please note - Your app will need to regenerate the user access tokens for previously authenticated users to access their email address.

请注意-您可以查看和编辑现有的 Twitter如果您通过 developer.twitter.com登录到Twitter帐户,则可以通过Twitter应用程序仪表板访问应用程序. .

Please note - You can view and edit your existing Twitter apps via the Twitter app dashboard if you are logged into your Twitter account on developer.twitter.com.

这篇关于如何使用codebird.php检索Twitter用户电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆