2011-08-31 79 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课程。没有想象中那么糟糕。谢谢。 –

相关问题