Archives For Google Base

Developing and integrating Magento with Google Base, and a variety of other Google Base related notes.

After some initial Google Base problems with Magento, I thought everything was going to be fine, only to get whacked with this error: Expected response code 200, got 403 Service forbidden: Account not registered for Google Base. I checked and checked again that my email/password was right, and that the Google account was registered for Google Base.

There wasn’t much help surfacing on Google for it, so I thought now that I have sifted through everything and looked at various sources, I’d compile a bit of an explanation and help guide for it. Please note this only affects, it is fixed in the newer versions of Magento, so unless you are wed to your current version, upgrade!

I posted a forum message on the Google Base boards and got this helpful reply:

  • verify the application is not exceeding the api
    limits of approximately 5 requests per second;
  • verify the proper uri is being used for the request.
  • verify all the required attributes and proper values
    are being used for the item-type being inserted —
    check that all the rules for the item-type are being met.

Given my products were not anything special, I doubted the last option. Also given others were reporting success with the Magento Google Base capability (once the initial problem was fixed), I assumed it wasn’t the 5 requests per second problem either. So what was wrong with the request URI?

Well, to cut a long story short, it seems that my problem was due to the account being used for Google Base, also being a Google Apps account. If you’re interested in the details check out the login options for the Google Account API. The hosted Google Apps account did not have Google Base, but the Google account (with the same email and password) did. The login was succeeding, but then the account that was logged-in did not have access to Google Base!

The fix is to tell the GClient API to use the Google account only, not the HOSTED_OR_GOOGLE default. I found others have suggested this fix (or the workaround of using a non-Google Apps account) here.

The gist of it is to change this function call by adding two extra parameters: app\code\core\Mage\GoogleBase\Model\Service.php on line 49. The two parameters to add are: Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, 'GOOGLE' as shown below.

$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, Zend_Gdata_Gbase::AUTH_SERVICE_NAME, null, '', $loginToken, $loginCaptcha, Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, 'GOOGLE');

That fixed the problem for me, now I just have to figure out which of the required Google Base attributes I’m missing!