TheIronYard--Orlando / 2015--SUMMER--ROR

Resources and homework for the Summer 2015 Ruby on Rails cohort @TheIronYard--Orlando.
9 stars 6 forks source link

19--Many-P-I--Erik Jenks #142

Open erikjenks opened 9 years ago

erikjenks commented 9 years ago

Not Just _A_PI, many PI

A short list of tasks for today; make your own checkboxes.

The problem I had in trying to post to the Meetup API was that I didn't read the HTTParty documentation closely enough.

The API wanted parameters like member_id and key, and I tried to put those in a hash as an argument to HTTParty.get like

HTTParty.get("https://api.meetup.com/2/rsvp", 
member_id: "self", key: "SOME_LONG_PRIVATE_DATA", rsvp: "yes" event_id: 118)

-but that doesn't quite work. HTTParty wants my hash wrapped in its own hash:

HTTParty.get("https://api.meetup.com/2/rsvp", query: { 
member_id: "self", key: "SOME_LONG_PRIVATE_DATA", rsvp: "yes" event_id: 118 
})

So, let that be a lesson for all of us.

erikjenks commented 9 years ago

response = HTTParty.get("https://api.meetup.com/2/events?key="insert key here"&group_urlname=meetup-api-testing&sign=true")