ошибка API Google Buzz API - PullRequest
       11

ошибка API Google Buzz API

0 голосов
/ 20 июля 2010

Я пытаюсь опубликовать контент в своем аккаунте Google Buzz с помощью API Google Buzz. Я попытался использовать предоставленный ими пример кода, но он выдает ошибку ниже

Array

( [http_code] => 401 [headers] => Array ( [WWW-Authenticate] => AuthSub realm = "https://www.google.com/accounts/AuthSubRequest" разрешенные области видимости =" https://www.googleapis.com/auth/buzz" [Content-Type] => application / json; кодировка = UTF-8 [Дата] => Вт, 20 июля 2010 12:22:05 GMT [Истекает] => Вт, 20 июля 2010 12:22:05 GMT [Cache-Control] => private, max-age = 0 [X-Content-Type-Options] => nosniff [X-Frame-Options] => SAMEORIGIN [X-XSS-Protection] => 1; Режим = Блок [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.
            )

    )

)

Я добавил переменные в файле config.php, которые были необходимы

'site_name' => 'example.com',

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

Кто-нибудь знает, что я могу здесь делать неправильно?

Как я могу хранить токены, которые возвращаются в базу данных ?? Поскольку при перезапуске сервера кеш теряется, и пользователям приходится снова проходить аутентификацию.

1 Ответ

1 голос
/ 22 июля 2010

Проблема была с доменом, который я передавал. Вместо передачи example.com я передавал http://example.com. Поэтому убедитесь, что переменные site_name, oauth_consumer_key и domain переданы правильно.

...