nicnocquee / Oauth-Module-for-Parse-Cloud-Code

A modified version of node-oauth to use in Parse Cloud Code
MIT License
19 stars 6 forks source link

Yelp V2 search API not work #1

Open chauchinyiu opened 10 years ago

chauchinyiu commented 10 years ago

Hello ,

I try to use your code to call yelp v2 API in parse. however, I always got the invalid signature problem. The only thing is different from your example is this line:

var orderedParameters= oa._prepareParameters(auth.accessToken, auth.accessTokenSecret, 'GET', finalUrl, null);

and of course also here: var webSearchUrl = 'http://api.yelp.com/v2/search'

Could you give me some hints how to call yelp v2 with your oauth module? thanks !

Liampronan commented 9 years ago

hey @chauchinyiu - I had the same invalid sig problem -- the issue on my end was with the URI encoding. I went ahead and removed the included uri encoding block and went with the following:

var finalUrl = webSearchUrl + '?' + "location=" + encodeURIComponent(location) + "&term=" + encodeURIComponent(searchTerm);

I know it's a bit after you asked, but leaving this here in case anyone else runs into a similar issue