发布于 2016-08-12 10:16:04
要请求用户的电子邮件地址,您的应用程序需要被Twitter白名单。要做到这一点,你需要:
I need access to special permissions选项。Email address。一旦您的请求被批准,或者如果您已经被白名单,您可以返回到https://apps.twitter.com,在应用程序权限部分下,将有一个新的复选框Request email addresses from users可用。您需要启用这个新选项。“隐私策略URL”和“服务条款”URL字段也将可用。
此时,您可以将include_email参数添加到account/verify_credentials请求中。
与此相关的几点:
null。发布于 2016-08-14 09:24:25
如果您的应用程序如建议的那样被白化,凭据
或者像@Hideo建议的那样
在服务器端你可以
获取请求:email=true
使用以下类型的auth 1.0 http报头
Authorization: OAuth oauth_consumer_key="KgpUD2nx5UCH9DllSIM4D****",
oauth_nonce="77252745154355061291979480247359",
oauth_signature="jPd5e5Z5ibKDb40JUjAuDVpi9TU%3D",
oauth_signature_method="HMAC-SHA1", oauth_timestamp="1471161684",
oauth_token="76472850016308****-qOqGdpxuVvT7Z7s5n9NFXqzIr11****",
oauth_version="1.0"在这里,oauth_token将按照这里的建议获得访问令牌,http://oauth.net/core/1.0/#anchor12
您将得到以下类型的响应:
{
"id": 75534037587985****,
"id_str": "75534037587985****",
"name": "tester",
"screen_name": "*********",
"location": "",
"description": "",
"url": null,
"entities": {
"description": {
"urls": []
}
},
"protected": false,
"followers_count": 0,
"friends_count": 19,
"listed_count": 0,
"created_at": "Tue Jul 19 09:55:54 +0000 2016",
"favourites_count": 0,
"utc_offset": null,
"time_zone": null,
"geo_enabled": false,
"verified": false,
"statuses_count": 0,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "F5F8FA",
"profile_background_image_url": null,
"profile_background_image_url_https": null,
"profile_background_tile": false,
"profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_4_normal.png",
"profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_4_normal.png",
"profile_link_color": "2B7BB9",
"profile_sidebar_border_color": "C0DEED",
"profile_sidebar_fill_color": "DDEEF6",
"profile_text_color": "333333",
"profile_use_background_image": true,
"has_extended_profile": false,
"default_profile": true,
"default_profile_image": true,
"following": false,
"follow_request_sent": false,
"notifications": false,
"email": "testerdaff@gmail.com"
}如果你有任何担心的话请告诉我。
https://stackoverflow.com/questions/38741323
复制相似问题