How to get email id of the user who accepted my Twitter application?
I have gone through a lot of forums. But they have mentioned, it is not possible. Also, those posts are older than a year. May I know whether it is possible to get the user email id through twitter API using PHP?
Answer:
Now you can fetch user email address from Twitter API and it's a lot much easier. Just follow these steps...
- Goto Twitter Apps
- Click on 'Create New App'
- Fill all required credentials and click on 'Create your Twitter application'
- Now click on 'Permissions' tab -> check 'Request email addresses from users' field and click on 'Update Settings'. (check given picture)
- Now in your PHP code, set all app details and add this code!
$params = array('include_email' => 'true', 'include_entities' => 'false', 'skip_status' => 'true');
$data = $connection->get('account/verify_credentials', $params); // get the data
// getting twitter user profile details $twt_id = $data->id; //twitter user id $twt_email = $data->email; //twitter user email
All Done. Hope it helps you, good luck.
No comments:
Post a Comment