0

I started to receive the following error a couple of weeks ago while creating or updating contacts, using Google Contacts API, authenticating using ClientLogin, coding using Delphi with Indy HTTP stack. The application used to work perfectly before that. Note that the application is fully using HTTPS following Google recent changes in that space (it actually worked for a few weeks after such changes got enforced). Reading contacts is still working.

HTTP Content-Type is set to 'application/atom+xml'. Google Contacts URL being used is 'https://www.google.com/m8/feeds/contacts/default/full'.

<?xml version="1.0" encoding="UTF-8"?>
<errors xmlns="http://schemas.google.com/g/2005">
 <error>
  <domain>GData</domain>
  <code>parseError</code>
  <internalReason>Parse Error</internalReason>
 </error>
</errors>

I don't know which kind of "parsing error" got introduced. Did something recently changed in that space? Understood that ClientLogin is deprecated, but is OAuth 2.0 now mandatory to actually update contacts?

1 Answers1

0

Are you including the Unicode BOM in the content payload? This can sometimes cause a parseError.

Blake O'Hare
  • 1,863
  • 12
  • 16
  • I wasn't explicitely writing the BOM at the TStringList level before saving the StringList to Stream with UTF-8 encoding. I've enabled the BOM writing (StringList.WriteBOM := True) but same result with the ParseError message. – cycocrew Jul 11 '14 at 09:58
  • Setting explicitely StringList.WriteBOM to False is solving the issue. So it seems that writing the BOM was actually the issue and after double checking, StringList.WriteBOM is actually set to True by default. – cycocrew Jul 11 '14 at 11:38
  • Also note that creating contacts is now returnning HTTP code 200 instead of 201 as described in API documentation (https://developers.google.com/google-apps/contacts/v3/#creating_contacts). – cycocrew Jul 11 '14 at 11:40