How to make a Yelp API request?

I'm just trying to make a Yelp API request as part of an iPhone app, and I don't know how to configure the request. I have all my authentication keys through Yelp, but I'm not sure what I need to enable. I don’t need users to log in to their account or anything like that, I just want to get feedback for displaying in my application.

Say I want to find the term search = food in location = San Francisco. My initial thought:

http://api.yelp.com/v2/search?term=food&location=San+Francisco&oauth_consumer_key=XXXXXXX&oauth_signature=XXXXXX&oauth_signature=XXXXXX&oauth_signature_method=HMAC-XHX&&XXX&&XXtemXo&timeXXtm

when i try to do this i get an INVALID_SIGNATURE error

What is the best way to request this information from Yelp? Also, should I pass authentication keys through a URL?

+6
source share
1 answer

How do you make a request out of curiosity? Yelp has an example library for receiving requests for iOS at: https://github.com/Yelp/yelp-api/tree/master/v2/ios/YelpAPI If you need an example of how they execute API requests.

Edit: I downloaded the Yelp iOS project and actually took the OAuth library and YAJL structure into a Xcode test account with ARC and Storyboards, however I had to add -fno-objc-arc to each of the OAuthConsumer libraries. After this process, after importing the OAuthConsumer.h file, the following code is executed: I created the gist, because the code tag was not entirely happy with how my code was formatted.

https://gist.github.com/dmason82/9200614

+1
source

All Articles