问题
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