I'm uploading a batch feed of mail messages to a gmail account, using
C# (MailItemService class Batch() method).
The Batch() call throws a "request failed" exception.
I looked at the debug output log ("gbase" service level), it shows a
non-empty Authorization header on the POST request, so initial
authentication must have succeeded, correct? But the response text
shows a "401" and an "Invalid token" message.

Here are the POST headers, and the response text (I snipped the
customer mail data in between, could supply privately if necessary):

Request at: 7/8/2008 1:23:48 PM
POST to: 
https://apps-apis.google.com/a/feeds/migration/2.0/guilford.edu/btester/mail/batch
Header: Content-Type:application/atom+xml; charset=UTF-8
Header: User-Agent:MailLogging GDataGAuth-CS/1.0.0
Header: Authorization:GoogleLogin
auth=DQAAAHwAAABfqx84XsLkwe6hXixPUZ6IohQMEI153dU9_LpPdSOWyMEdmklntgtMDm8hCixJnkVfK9WvIUes3UohNWUhy36KUrGAbmvp_DqZ6oV70SPjjJ7xblGUWNTLPlE6kxRzZLOb2--
dU6M4RVOZWzx_9e1UJ81oW7DH3459VZuRBgHv5w
Header: Host:apps-apis.google.com
Header: Content-Length:1204723
Header: Expect:100-continue
Header: Connection:Keep-Alive
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"; xmlns:batch="http://
schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/
2005">

<!-- snip.... !!>

Response received at: 7/8/2008 1:23:49 PM
Header: Content-Length:149
Header: Cache-Control:private, max-age=0
Header: Content-Type:text/html; charset=UTF-8
Header: Date:Tue, 08 Jul 2008 17:23:53 GMT
Header: Expires:Tue, 08 Jul 2008 17:23:53 GMT
Header: Server:GFE/1.3
Header: WWW-Authenticate:GoogleLogin realm="http://www.google.com/
accounts/ClientLogin", service="apps"
<HTML>
<HEAD>
<TITLE>Token invalid</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Token invalid</H1>
<H2>Error 401</H2>
</BODY>
</HTML>

NOTE: The account is definitely enabled for API access. Originally
when we got this exact same behavior, we checked, and the account was
NOT enabled for API, so we enabled it. Then, on a couple of test runs,
the upload worked fine. Now, hours later, it is again not working.

We can log in to the account with Firefox, no captcha prompt or
anything else in the way.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Apps APIs" 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-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to