views:

234

answers:

1

With the Google Contacts API, you can GET contact information using JSON, but is there a way to update it using JSON? I haven't had any success in my attempts, and continue to get a "content not allowed in prolog" error when I try (seemingly indicating that they're expecting XML in the PUT request).

On the GET request, I GET from following URL: http://www.google.com/m8/feeds/contacts/[email protected]/full?alt=json

When I want to update a contact using XML I PUT to the following type of URL (it varies based on which contact is being updated): http://www.google.com/m8/feeds/contacts/[email protected]/base/0

I've tried adding alt=json onto the PUT request, but that was just a shot in the dark since I haven't found any actual documentation to confirm updating using JSON is even possible. I'm doing this interaction in JS from a firefox addon, so that's why my preference is to use JSON (I've been working with E4X up until this point and find it to be pretty janky).

Any help would be greatly appreciated!

+2  A: 

I see no traces about "update google contact using JSON in PUT".

Google dev guide says:

To update an existing contact, first retrieve the entry you want to update, modify it, and then send a PUT request with the updated entry in the message body to the contact's edit URL. Use the application/atom+xml content type

(from http://code.google.com/apis/contacts/docs/3.0/developers%5Fguide%5Fprotocol.html#Updating )

zmila