Where to put the application ID in YQL
I'm trying to read an xml response from YQL:
$url = 'h开发者_开发知识库ttp://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20woeid%3D%22'.$woeid.'%22';
if (!$xml=simplexml_load_file($url) )
{
//DO STUFF
}
This code works. Now i'm trying to put my application ID in the url string but I don't know how it should be done.
Thanks.
I assume that you want to do this in order to authorize your requests; for example, to receive the higher rate limits, etc.?
YQL uses OAuth for authorization rather than simply adding an API key or appID into a request URL. The process is well documented and their code examples covers requests using 2-legged and 3-legged OAuth in both PHP and JavaScript.
Is there any reason why the public (non-authed) service doesn't suit your needs?
精彩评论