2011-08-31 78 views
-1
I am trying to access the user info or user id after authenticating the user. 
I have this url I call with 
curl_init(https://www.googleapis.com/buzz/v1/people/@me/@self) 
but it doesn't work. It says: 
<?xml version="1.0" encoding="UTF-8"?> 
<errors xmlns="http://schemas.google.com/g/2005"><error> 
<domain>GData</domain> 
<code>authError</code> 
<location type="header">Authorization</location> 
<internalReason>@me called by anonymous</internalReason></error></errors> 

So I added a key at the end 
curl_init(https://www.googleapis.com/buzz/v1/people/@me/@self?key="...") 
But it says "Bad Request Access not Configured"..I am geting now where.. 
any ideas? THanks 

回答

1

您需要使用OAuth。您不能僅僅對API進行未經身份驗證的HTTP請求。有關API,請參閱authorization的文檔。此外,關鍵參數需要是從API Console獲得的開發人員密鑰。

+0

是的。沒有回覆後,我最終使用Google Buzz課程。沒有想象中那麼糟糕。謝謝。 –

相關問題