Hello Aniket,

If you are using 2-legged OAuth, you would have to specify the user being
logged-in as with the "xoauth_requestor_id" query parameter.
As I can see in your code, contactId is saved from
"contactEntry.getSelfLink().getHref()" which should already have a "full"
projection.

If this is not the case, please make sure to indeed use the contact's self
or edit link and not the contact's Id.

Also, have you tried doing this:

ContactEntry contactEntry = myService.getEntry( new
URL(contactId.replace("/base/", "/full/") + "*
?xoauth_requestor_id=<ADMIN_EMAIL>*"), ContactEntry.class);

Best,
Alain

On Tue, Jul 12, 2011 at 12:25 AM, Aniket Ghode <[email protected]>wrote:

> Hi,
>
> I could retrieve all domain shared contacts using 2-legged OAuth, But I
> have a new problem now.
>
> When I tried to retrieve a single shared contact using
> ContactsService.getEntry, I am getting
>
> java.lang.**NullPointerException: No authentication header information.
>
> I am persisting the links for shared contacts and using it to retrieve the
> contactentry for editing or/and deleting
>
> ContactsService myService = new
> ContactsService(Constants.APPLICATION_NAME); GoogleOAuthParameters
> oauthParameters = new GoogleOAuthParameters();
> oauthParameters.setOAuthConsumerKey(consumerKey);
> oauthParameters.setOAuthConsumerSecret(consumerSecret);
> oauthParameters.setOAuthType(OAuthType.TWO_LEGGED_OAUTH);
> oauthParameters.setScope("https://www.google.com/m8/feeds/";);
> myService.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());
> // Contact id is from contactentry.getSelfLink.getHREF
>
> ContactEntry contactEntry = myService.getEntry( new
> URL(contactId.replace("/base/", "/full/")), ContactEntry.class);
>
> Please let me know any workaround to avoid this exception.
>
> Thanks,
> Aniket
>
> --
> 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
>



-- 
Alain Vongsouvanh

-- 
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

Reply via email to