how to decode google contact v3 photo name

311 views Asked by At

How to decode this image name (with extension)

<link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/[email protected]/2d4aaf09b20bb7"/>
  <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/[email protected]/full/2d4aaf09b20bb7"/>
  <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/[email protected]/full/2d4aaf09b20bb7"/>
2

There are 2 answers

0
David On BEST ANSWER

You are getting an HTTP 401 error, which means that you are not authorized to access the image (more info here).

Are you accessing the image url directly with the browser or with your API client ? You need to provide a proper OAuth token to access the image.

0
Akshay Gaur On

You can't take the URL and paste it in the browser (if I understand the question correctly). You would have to send a authorized GET request as mentioned in the Google Contact API guide here.

To retrieve a contact's photo, send an authorized GET request to the contact's photo link URL.

So essentially, you would use the same tokens as you used to receive the contact details (I am assuming you are using GData Contact API).