0
我去了微軟開發者網站,獲得了客戶端ID和客戶端密碼。此錯誤消息是什麼意思?
以下是我的源代碼。我更換了最後兩位數字與XX
<?php
$ClientID='000000004C12B0XX';
$ClientSecret='yAFqUbNwCqSbs-dQJ5BzF1tWBZggFWXX';
$ClientSecret = urlencode($ClientSecret);
$ClientID = urlencode($ClientID);
// Get a 10-minute access token for Microsoft Translator API.
$url = "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13";
$postParams = "grant_type=client_credentials&client_id=$ClientID&client_secret=$ClientSecret&scope=http://api.microsofttranslator.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$rsp = curl_exec($ch);
print $rsp;
?>
而且我收到錯誤消息是
{
"error":"invalid_client",
"error_description":"ACS50012: Authentication failed.
Trace ID: e2f0bfde-d086-4900-ba1f-a58f02693dac
Correlation ID: 3750d010-2e9f-45c5-8ba0-f28dfc050909
Timestamp: 2014-10-20 17:20:26Z"
}