简体   繁体   中英

google buzz api error

I am trying to post some content to my google buzz account using google buzz api. 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 )

[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

'site_name' => 'example.com',

'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 . So make sure the site_name , oauth_consumer_key and domain variables are passed properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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