我正在尝试访问 appannie.com 的 api。我似乎无法通过身份验证。这就是我所拥有的,有什么想法吗?
<?php
$whmusername = "username";
$whmpassword = "password";
$query = "https://api.appannie.com/v1/accounts";
$ch = curl_init();
// Sets the URL cURL will open
curl_setopt($ch, CURLOPT_URL, $query);
// Here's the HTTP auth
// The 3rd argument is your Twitter username and password joined with a colon
curl_setopt($ch, CURLOPT_USERPWD, $whmusername.":".$whmpassword);
// Makes curl_exec() return server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// And here's the result XML
$response = curl_exec($ch);
curl_close($ch);
print $response;
?>
这是他们的 api 文档的链接:http: //appannie.zendesk.com/categories/20082753-Analytics-API http://support.appannie.com/entries/23215057-2-Authentication