Reputation: 1372
I am just trying to make a Yelp API request as part of an iPhone app and I don't know how to set up the request. I have all of my authentication keys via Yelp, but I'm not sure what all I need to include. I don't need to have users sign in to their account or anything, I just want to be able to retrieve reviews to display in my app.
Say I want to the search term=food in location=San Francisco. My initial thought is to do:
when I try this I get an INVALID_SIGNATURE error
What is the best way to request this information from Yelp? Also, am I supposed to pass my authentication keys via the URL?
Upvotes: 5
Views: 3552
Reputation: 399
How are you doing the request out of curiosity? Yelp does have an example library for getting requests on iOS at: https://github.com/Yelp/yelp-api/tree/master/v2/ios/YelpAPI If you wanted an example of how they do API requests.
Edit: I did a download of Yelp's iOS project, and actually took the OAuth library and YAJL framework into a test XCode account with ARC and Storyboards, however I did have to add -fno-objc-arc to each of the OAuthConsumer libraries. After that process, the following code works after you import the OAuthConsumer.h file: I created a gist, since the code tag wasn't quite happy with how my code was formatted.
https://gist.github.com/dmason82/9200614
Upvotes: 1