如何从TwitterApi获取用户电子邮件

时间:2016-03-16 14:14:12

标签: php email twitter-oauth

我已在我的网站上成功实施了推特API:

使用的API:亚伯拉罕·威廉姆斯的推特oAuth

http://fr.illustranews.com

我已经要求获得Twitter的扩展许可,以便能够获取已登录用户的电子邮件。

但是,当我看到Twitter的回复时,我找不到该电子邮件。

以下是回复:

stdClass Object (
    [id] => 159518456 
    [id_str] => 159518456 
    [name] => Mautech Consulting 
    [screen_name] => Mau_tech 
    [location] => Viney road, Calodyne,Mauritius 
    [description] => Your IT Consulting expert. We are the creators of http://t.co/lCXGEiOsrT 
    [url] => http://t.co/vFV9W9m5NJ 
    [entities] => stdClass Object ( 
        [url] => stdClass Object ( 
            [urls] => Array ( 
                [0] => stdClass Object ( 
                    [url] => http://t.co/vFV9W9m5NJ 
                    [expanded_url] => http://www.mautechconsulting.com 
                    [display_url] => mautechconsulting.com 
                    [indices] => Array ( [0] => 0 [1] => 22 
                ) 
            ) 
        ) 
    ) 
    [description] => stdClass Object ( 
    [urls] => Array ( 
        [0] => stdClass Object ( 
            [url] => http://t.co/lCXGEiOsrT 
            [expanded_url] => http://www.professionals.mu 
            [display_url] => professionals.mu 
            [indices] => Array ( [0] => 50 [1] => 72 ) ) ) ) ) 
    [protected] => 
    [followers_count] => 1403 
    [friends_count] => 1805 
    [listed_count] => 5 
    [created_at] => Fri Jun 25 16:14:34 +0000 2010 
    [favourites_count] => 2 
    [utc_offset] => 14400 
    [time_zone] => Abu Dhabi 
    [geo_enabled] => 
    [verified] => 
    [statuses_count] => 341 
    [lang] => en 
    [status] => stdClass Object ( 
        [created_at] => Fri Mar 11 09:08:37 +0000 2016 
        [id] => 708218057567682560 
        [id_str] => 708218057567682560 
        [text] => VPS Hosting | Windows Cloud Hosting | Windows Reseller - AccuWeb Hosting https://t.co/0exTmiLClc 
        [truncated] => 
        [source] => Facebook 
        [in_reply_to_status_id] => 
        [in_reply_to_status_id_str] => 
        [in_reply_to_user_id] => [
        in_reply_to_user_id_str] => 
        [in_reply_to_screen_name] => 
        [geo] => 
        [coordinates] => 
        [place] => 
        [contributors] => 
        [is_quote_status] => 
        [retweet_count] => 0 
        [favorite_count] => 0 
        [entities] => stdClass Object ( 
            [hashtags] => Array ( ) 
            [symbols] => Array ( ) 
            [user_mentions] => Array ( ) 
            [urls] => Array ( 
                [0] => stdClass Object ( 
                    [url] => https://t.co/0exTmiLClc 
                    [expanded_url] => http://fb.me/4uCDHL6lZ 
                    [display_url] => fb.me/4uCDHL6lZ 
                    [indices] => Array ( [0] => 73 [1] => 96 ) 
                ) 
            ) 
        ) 
        [favorited] => 
        [retweeted] => 
        [possibly_sensitive] => 
        [lang] => en 
    ) 
    [contributors_enabled] => 
    [is_translator] => 
    [is_translation_enabled] => 
    [profile_background_color] => F0F5F5 
    [profile_background_image_url] => http://pbs.twimg.com/profile_background_images/436354814457303040/nOQaWO-w.png 
    [profile_background_image_url_https] => https://pbs.twimg.com/profile_background_images/436354814457303040/nOQaWO-w.png 
    [profile_background_tile] => 
    [profile_image_url] => http://pbs.twimg.com/profile_images/378800000801085164/b77fd09a53c4dcca068297874728c2fb_normal.png 
    [profile_image_url_https] => https://pbs.twimg.com/profile_images/378800000801085164/b77fd09a53c4dcca068297874728c2fb_normal.png 
    [profile_link_color] => 0084B4 
    [profile_sidebar_border_color] => FFFFFF 
    [profile_sidebar_fill_color] => DDFFCC 
    [profile_text_color] => 333333 
    [profile_use_background_image] => 1 
    [has_extended_profile] => 
    [default_profile] => 
    [default_profile_image] => 
    [following] => 
    [follow_request_sent] => 
    [notifications] => 
)
你能帮帮忙吗?

1 个答案:

答案 0 :(得分:0)

除非您的应用是白名单,否则无法使用Twitter API获取用户的电子邮件地址。

检查此答案:https://stackoverflow.com/a/3627563/5663598 来自该答案的链接作为参考:

API通话详情:https://dev.twitter.com/rest/reference/get/account/verify_credentials