Get email address from Twitter

548 views Asked by At

Recently Twitter updated their API allowing developers to access users' email address.

I'm working on a website application and I'm trying to get the email address from Twitter during the signup process. I have elevated permissions and I set 'include_email' flag to true, but the Twitter API is not sending back any email fields.

Any help is much appreciated.

1

There are 1 answers

1
DanClowdy On

I found the problem. I'm using tmhOAuth from https://github.com/themattharris/tmhOAuth and it transforms TRUE to 1 and FALSE to '' (empty string). Twitter API expects include_email=true and the client was passing include_email=1.

Setting true to 'true' (string) did the trick and now it works.