Page 1 of 1

Yelp Search API, Does It Work As A Service IN Appery.io ??!!

Posted: Sat Oct 25, 2014 12:41 am
by Shaun Rodgers

Hi,

Does anyone know how to add the Yelp Search API to Appery.io?

I want to add local business search to my App based on specific search terms and list them, nearest first in a list box.

I've created a Service and added all of the parameters such as, oauth_codes etc. but I'm getting errors when I test the service.

Any help from anyone who's managed this would be gratefully accepted!!

thanks

Shaun


Yelp Search API, Does It Work As A Service IN Appery.io ??!!

Posted: Sat Oct 25, 2014 12:02 pm
by Shaun Rodgers

After days of trying and reading everything I can find, these are my results so far...

I thought the oauth_signature was generated BY the request not as an input...obviously not by this result!

Input ( see api_test_1.png)

{
"status":400,
"uri":"http://api.yelp.com/v2/search",
"response":{
"error":{
"text":"One or more parameters are missing in request",
"id":"MISSING_PARAMETER",
"field":"oauth_signature"
}
}
}

I don't know what code to add to the oauth_signature parameter, I did read that I needed to concatenate the result of HMAC-SHA1 and the oauth_token_secret key but I don't know how to do that, even if that made sense!

Below I tried to use the oauth_token_secret key on it's own...

Input ( see api_test_2.png)

{
"status":400,
"uri":"http://api.yelp.com/v2/search",
"response":{
"error":{
"text":"Signature was invalid",
"id":"INVALID_SIGNATURE",
"description":"Invalid signature. Expected signature base string: GET&http%3A%2F%2Fapi.yelp.com%2Fv2%2Fsearch&location%3Dlondon%26oauth_consumer_key%3DOXXXXXXXX-JDn2CADA%26oauth_nonce%3DsaXXXXXXXXXhu7%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1485532322%26oauth_token%3DBXXXXXXXXXA6Zezz9gXXXXXXXgJp9Sto%26term%3Dlawyer"
}
}
} Image Image


Yelp Search API, Does It Work As A Service IN Appery.io ??!!

Posted: Mon Oct 27, 2014 4:19 am
by Yurii Orishchuk

Hi Shawn,

You can use any 3rd party api via appery services.

We didn't work with this yelp api and can not tell you exactly what is wrong.

But if you have correct response that you can emulate in different features - we can help to build this request in appery service.

Also it's better to ask in Yelp support about what is wrong in your request(what is missing ..)

Regards.


Yelp Search API, Does It Work As A Service IN Appery.io ??!!

Posted: Mon Oct 27, 2014 9:51 am
by Shaun Rodgers

Hi,

I have asked the same question in Yelp Developer Support on Google, but I've had no response yet.

You say you can help me build this request, what information do you need from me to do this?

I know others will also want to use this API Request, so it would be very helpful if a generic request was created by someone who knows what they are doing, unlike me!

thanks


Yelp Search API, Does It Work As A Service IN Appery.io ??!!

Posted: Tue Oct 28, 2014 11:50 pm
by Yurii Orishchuk

Hi Shaun,

As i can see in YELP documentation you should use OAUTH 1.0a to authorize.

See details here: http://www.yelp.com/developers/docume...

So you should pass parameters by headers described there.

Also you can use following library to create correct "oauth_signature" parameter:

https://www.npmjs.org/package/oauth-1.0a

Regards.


Yelp Search API, Does It Work As A Service IN Appery.io ??!!

Posted: Thu Feb 05, 2015 6:04 am
by Nevin Raj

I'm having trouble with this too. How do you error check / test? I can't use the Test feature in the service because the oauth_signature parameter is too complex to hard code.


Yelp Search API, Does It Work As A Service IN Appery.io ??!!

Posted: Thu Feb 05, 2015 7:45 am
by Evgene Karachevtsev

Hello Nevin,

Probably the easiest way is to check for the errors in a browser console and use Weinre:
http://devcenter.appery.io/documentat...


Yelp Search API, Does It Work As A Service IN Appery.io ??!!

Posted: Fri Feb 06, 2015 4:28 am
by Nevin Raj

Thanks for the tip but Weinre actually doesn't help much. (It doesn't give me anything more than selecting "Inspect Element" in Chrome.)

Let me rephrase the question as I've narrowed down my issue: I'm trying to figure out how to generate the oauth_signature parameter. I tried looking through the link in an earlier post (https://www.npmjs.org/package/oauth-1.0a). Not sure how to implement this in an Appery service. Do you have any guidance? The documentation in the link doesn't help me understand, for example, the output of the .authorize function, as I would need to pull the signature component and not the full header.


Yelp Search API, Does It Work As A Service IN Appery.io ??!!

Posted: Mon Feb 09, 2015 2:24 am
by Yurii Orishchuk

Hi Nevin,

Please follow documentation in that link: https://www.npmjs.org/package/oauth-1.0a

Details:

  1. Instalation http://prntscr.com/62u6od/direct

  2. Using: http://prntscr.com/62u6y3/direct

    Regards.