I have a simple application written in PHP 5 using the cURL library
using the following URL's, headers and posted data.

It logs in OK and I get a 'valid' auth code, but when I try to upload
a batch feed I get a 401 error Authorisation Error.

Does anybody what this message is referring to in the context of
submitting a batch feed, if I knew this I could find the problem in
the code.

Log in to account using following:-
URL: https://www.google.com/accounts/ClientLogin
Headers:
Content-type: application/x-www-form-urlencoded
Post data:
accountType=HOSTED_OR_GOOGLE&[email protected]&Passwd=1234&
service=xapi&source=xyz-abc-1.2

The login processs returns a valid ‘auth=’, SID= and LSID=


Submit batch feed using following:-
URL: http://www.google.com/base/feeds/items/batch
Headers:
Content-Type: application/atom+xml
Content-length: 123
GoogleLogin auth=[received auth token]
X-Google-Key: key=[API Key]
GData-Version: 2
Post data:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom";
    xmlns:openSearch=http://a9.com/-/spec/opensearchrss/1.0/
    xmlns:g="http://base.google.com/ns/1.0";
    xmlns:batch="http://schemas.google.com/gdata/batch";>
  <title type="text">My Batch Feed</title>
…..
…..
</feed>

This returns the error:
Authorization required
Error 401

Thanks in advance
Dave Watson
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Base Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Base-data-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to