简体   繁体   English

Google Buzz API错误

[英]google buzz api error

I am trying to post some content to my google buzz account using google buzz api. 我正在尝试使用Google Buzz API将一些内容发布到我的Google Buzz帐户中。 I tried using their sample code that they have provided ,but it give the below error 我尝试使用他们提供的示例代码,但出现以下错误

Array

( [http_code] => 401 [headers] => Array ( [WWW-Authenticate] => AuthSub realm="https://www.google.com/accounts/AuthSubRequest" allowed-scopes="https://www.googleapis.com/auth/buzz" [Content-Type] => application/json; charset=UTF-8 [Date] => Tue, 20 Jul 2010 12:22:05 GMT [Expires] => Tue, 20 Jul 2010 12:22:05 GMT [Cache-Control] => private, max-age=0 [X-Content-Type-Options] => nosniff [X-Frame-Options] => SAMEORIGIN [X-XSS-Protection] => 1; mode=block [Server] => GSE [Transfer-Encoding] => chunked ) ([http_code] => 401 [headers] =>数组([WWW-Authenticate] => AuthSub realm =“ https://www.google.com/accounts/AuthSubRequest” allowed-scopes =“ https:// www。 googleapis.com/auth/buzz“ [内容类型] => application / json; charset = UTF-8 [日期] => 2010年7月20日,星期二12:22:05 GMT [过期] => 2010年7月20日,星期二12:22:05 GMT [Cache-Control] =>私有,最大年龄= 0 [X-Content-Type-Options] => nosniff [X-Frame-Options] => SAMEORIGIN [X-XSS-Protection] = > 1; mode = block [服务器] => GSE [传输编码] =>分块)

[data] => Array
    (
        [error] => Array
            (
                [errors] => Array
                    (
                        [0] => Array
                            (
                                [message] => User must have authorized this application to have the following scope in order to make this call: [https://www.googleapis.com/auth/buzz]  Also , make sure your application is using the Buzz specific OAuth authorization URL.
                                [locationType] => header
                                [location] => Authorization
                            )

                    )

                [code] => 401
                [message] => User must have authorized this application to have the following scope in order to make this call: [https://www.googleapis.com/auth/buzz]  Also , make sure your application is using the Buzz specific OAuth authorization URL.
            )

    )

)

i have added the variables in the config.php file which were required 我已经在config.php文件中添加了必需的变量

'site_name' => 'example.com',

'oauth_consumer_key' => 'example.com', 'oauth_consumer_secret' => 'consumersecret', 'oauth_rsa_key' => '', 'oauth_consumer_key'=>'example.com','oauth_consumer_secret'=>'consumersecret','oauth_rsa_key'=>'',

Does anybody know what i might be doing wrong here?? 有人知道我在这里做错什么吗?

How can i store the tokens that are returned to the database?? 如何存储返回到数据库的令牌? Since if the server is restarted the cache is lost and the users have to authenticate again. 由于如果服务器重新启动,则缓存将丢失,并且用户必须再次进行身份验证。

The issue was with the domain that i was passing. 问题出在我正在传递的域名上。 Instead of passing example.com i was passing http://example.com . 我没有通过example.com而是通过http://example.com So make sure the site_name , oauth_consumer_key and domain variables are passed properly. 因此,请确保正确传递site_name,oauth_consumer_key和域变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM