YQL API Request Private Data Authentication Error

六月ゝ 毕业季﹏ 提交于 2019-12-14 03:57:40

问题


I am using YQL to pull some data for my yahoo fantasy football league. I have created the app and it gave me a consumer/secret key but how do I pass this information to the yahoo api to log me in? I know I have to use OAuth but I am not sure how to use the key in tandem with CURL and YQL

Here is my PHP Code:

<pre>
<?php
  $BASE_URL = "https://query.yahooapis.com/v1/public/yql";

    // Form YQL query and build URI to YQL Web service
    $yql_query = "select * from fantasysports.leagues.standings where league_key='331.l.777400'";
    $yql_query_url = $BASE_URL . "?q=" . urlencode($yql_query) . "&format=json";

    // Make call with cURL
    $session = curl_init($yql_query_url);
    curl_setopt($session, CURLOPT_RETURNTRANSFER,true);
    $json = curl_exec($session);
    // Convert JSON to PHP object 
    $phpObj =  json_decode($json);
    var_dump($phpObj);
?>
</pre>

and the error I get is

"Authentication Error. The table fantasysports.leagues.standings requires a higher security level than is provided, you provided ANY but at least USER is expected"

来源:https://stackoverflow.com/questions/26153252/yql-api-request-private-data-authentication-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!