Hello again I've really stuck with this, let me be more exact on how I'm
trying to accomplish image retrieval from contact profile in google
contacts.
First of all I'm using OAuth 3legged. The scope for authentication is
*https://www.google.com/feeds/contacts
https://docs.google.com/feeds/ *
I'm sure it is correct, and I'm sure I've got correct auth parameters and
access token because I CAN RETRIEVE CONTACT ENTRIES, DOCS ENTRIES and
everything I want.
After retrieving contact full profile I'm executing code to retrieve image
for that contact:
ContactEntry entry = service.getEntry(contactURL,ContactEntry.class);
Link photoLink = entry.getContactPhotoLink();
if (photoLink !=null && photoLink.getEtag()!=null)
{
GDataRequest request = service.createLinkQueryRequest(photoLink);
request.execute();
// No Authentication header information
InputStream stream = req.getResponseStream();
}
Execution is broken and exception with message "No Authentication header
information" is raised.
Ok so I'm thinking.. Hmmmmmmmm Hmmmmmmmm Hmmmmmm maybe there is a bug in
api. Maybe I should switch to more low level approach...
Let us try with auth post and UrlFetch:
String resource = "
https://www.google.com/m8/feeds/photos/media/default/18a637490f9e026f"
GoolgeOAuthParameters oauthParameters = tokenManager.
getAuthParameters(email);
OAuthConsumer consumer = new DefaultOAuthConsumer(
oauthParameters.getOAuthToken(),oauthParameters.getOAuthTokenSecret);
URL url = new URL(resource);
HttpURLConnection request = (HttpURLConnection)url.openConnection();
consumer.sign(request);
request.connect();
request.getInputStream();
The exeption is now slightly different - the message is 401 unauthorized
access but I'm sure the reason is the same.
So now I would like to ask the people who are managed to fetch image.. How
do You succedeed ?
Api
gdata-contacts-3.0-1.41.5.jar
gdata-core-1.0-1.41.5.jar
gdata-base-1.0-1.41.5.jar
gdata-client-1.0-1.41.5 jar
--
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles 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://code.google.com/apis/contacts/community/forum.html