I have implemented a simple api in python to get an OAuth2 access token from a user in meetup. How can I get a unique identifier from that user, using the access token, other than the token itself? For example, if I'm given an access token, how can I get that users email address?
You can make a call to https://api.meetup.com/2/member/self.
PHP example with cURL library:
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, 'https://api.meetup.com/2/member/self');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: bearer ' . $accessToken
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
$userData = json_decode($result);
You can get the ID from the user like $userData->id. As far as I know E-mail is not provided by this API call, at least not as a default anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With