Editing contact photos using curl


You can use curl to modify Contacts API contact photos from the command line.

To start, you'll need to get the photo edit link from the contacts feed. This is expressed in the feed as the following XML element:

<link rel="http://schemas.google.com/contacts/2008/rel#photo-edit type="image/*" href="http://www.google.com/m8/feeds/photos/media/user/id/version" />

The photo edit link is contained inside the href attribute. For this example, it would be http://www.google.com/m8/feeds/photos/media/user/id/version.

Once you have this, you can add or update a photo by running:

curl -H "Authorization: GoogleLogin ..." \
-H "Content-Type: image/jpeg" \
-X PUT \
--binary-data "@/path/to/image.jpg" \
http://www.google.com/m8/feeds/photos/media/user/id/version

Be sure to replace the Content-Type and file path with appropriate values for your new photo.

To delete a photo, run:

curl -H "Authorization: GoogleLogin ..." \
-X DELETE \
http://www.google.com/m8/feeds/photos/media/user/id/version

You'll need to make sure that the Authorization header contains a valid ClientLogin token, as explained in the tip "Perform ClientLogin using curl.

2 comments:

cmtech said...

I need information from your document. Thank you for having great ideas
cửa gỗ

Sandhya Delhi Escort Service said...


The hectic world, a usual silhouette of wrinkled-faces and lack of time & good people make absolute absence of Love in our lives. Only a smile means to exist in the whole world bringing itself a Comet of Love. So it takes you believe onAerocity Escorts Serviceliable to fulfill your lives with real sense of love. Check our other Services...
Booking of Call Girls
Call Girls in Aerocity
Air Hostess Escorts in Ahmedabad
Call Girls in Ahmedabad
Ahmedabad Escorts Service
Ashram Road Escorts Service, Ahmedabad
Call Girls in Ahmedabad