Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get a unique identifier associated with a meetup access token?

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?

like image 837
user1876508 Avatar asked Nov 17 '25 22:11

user1876508


1 Answers

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.

like image 125
Ray Burgemeestre Avatar answered Nov 19 '25 15:11

Ray Burgemeestre