简体   繁体   中英

Rails: how to use Meetup API key to return a list of events

Using Meetup API, I'm trying to retrieve and display a list of events from multiple groups. The application is using RoR, I am new to using APIs but trying to understand how this works.

The idea is to have each user enter their group's Meetup API key and group name in a form. Using this information, send a request to Meetup and return the list of events for that user/group. This is then displayed with all current events from multiple groups.

Been looking through the Meetup API documentations and it looks like I can send the URL request like this: https://api.meetup.com/2/events?&sign=true&photo-host=public&group_urlname=sventrepreneurs&page=20 where group name = sventrepreneurs (for example) to return a response in JSON format.

And if I use an API key, this also works: https://api.meetup.com/2/events?key=API_KEY&sign=true&photo-host=public&group_urlname=sventrepreneurs&page=20

Does that mean I can just have the user enter their group name to do a request of the upcoming events from that group instead of them entering their API key?

Any insights would help. Thanks!

I guess that this is a perfect example of why you would like to use Oauth, because you don't want anyone to just share their API-key in your environment.

There are gems and strategies out there for it. For example: https://github.com/tapster/omniauth-meetup

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM