The Yelp API uses oAuth1.0a to authorize and identify the calling API, not the end user that the application can use. This is not like a Twitter script where you should let your users log in. Therefore, you do not need access token URLs or other data. You can create all the necessary tokens to get started. Here's how your API console should look like once everything is configured (I messed up my keys by default) -

Now you need to make server-side API calls using UrlFetchApp and not use jQuery AJAX APIs, as this Yelp API does not seem to allow the use of CORS and JSONP in the HtmlService. Otherwise, you will get errors, as shown below in the console -

Finally, here is a sample code to get you started. I based them on my JavaScript sample -
var auth = { consumerKey: "YOURKEY", consumerSecret: "YOURSECRET", accessToken: "YOURTOKEN", accessTokenSecret: "YOURTOKENSECRET", }; var terms = 'food'; var near = 'San+Francisco'; var accessor = { consumerSecret: auth.consumerSecret, tokenSecret: auth.accessTokenSecret }; var parameters = []; parameters.push(['term', terms]); parameters.push(['location', near]); parameters.push(['oauth_consumer_key', auth.consumerKey]); parameters.push(['oauth_consumer_secret', auth.consumerSecret]); parameters.push(['oauth_token', auth.accessToken]); var message = { 'action': 'http://api.yelp.com/v2/search', 'method': 'GET', 'parameters': parameters }; OAuth.setTimestampAndNonce(message); OAuth.SignatureMethod.sign(message, accessor); var parameterMap = OAuth.getParameterMap(message.parameters); parameterMap.oauth_signature = OAuth.percentEncode(parameterMap.oauth_signature) var url = OAuth.addToURL(message.action,parameterMap); var response = UrlFetchApp.fetch(url).getContentText(); var responseObject = Utilities.jsonParse(response);
I also added a couple GS script files with oAuth JS and SHA1 JS code contents from the provided links (just copy the insert into the new files in the script editor). However, if you consider yourself adventurous, you can also use the Utilities APIs to manually sign and encode the necessary oAuth parameters.
Hope this helps. I was able to get Yelp answers with all the samples provided.
source share