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:
http://api.yelp.com/v2/search?term=food&location=San+Francisco&oauth_consumer_key=XXXXXXX&oauth_nonce=XXXXX&oauth_signature=XXXXXX&oauth_signature_method=HMAC-SHA1&oauth_timestamp=XXXXX&oauth_token=XXXX
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?
The Yelp API provides data from millions of businesses across the world. It contains data such as business ratings, reviews, locations, photos, and a plethora of other details. In this guide, you will learn everything you need to know to set up your own Yelp account and how to make requests with the Yelp API.
You can make a request through Yelp's data download tool as described below: Desktop: Go to your Privacy Settings and click on the link to Download a copy of your Yelp data in the upper right corner of the page.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With