0

Previously i can access google contacts using consumer key and consumer secret.

GoogleOAuthParameters  objParametersPro = new GoogleOAuthParameters();
ContactsService contactService = new ContactsService("App_Name");
objParametersPro.setOAuthConsumerKey(m_sConsumerKey);
objParametersPro.setOAuthConsumerSecret(m_sConsumerSecret);
objParametersPro.setOAuthType(OAuthType.TWO_LEGGED_OAUTH);
OAuthSigner objSignerPrp = new OAuthHmacSha1Signer();
objParametersPro.addCustomBaseParameter("xoauth_requestor_id",adminEmail);
contactService.setOAuthCredentials(objParametersPro, objSignerPrp);
contactService.setHeader("GData-Version", "3.0");
try {
    String url="https://www.google.com/m8/feeds/contacts/"+domain+"/full/"+contactId;
                entry = contactService.getEntry(new URL(url),ContactEntry.class);
} catch (Exception e1) {
  e1.printStackTrace();
log.warning("exception in create entry obj"+e1);
}

But now i am have to use oauth 2.0. can anyone have sample example of it or piece of code ?

RBP
  • 481
  • 1
  • 9
  • 29
  • I am getting below error com.google.gdata.util.ResourceNotFoundException: OK Error 404 (Not Found)!!1

    404. That's an error.

    The requested URL /m8 was not found on this server. That's all we know.

    . i have already added contact url into scope. what thing am i missing..?
    – RBP Feb 03 '14 at 11:29
  • can anyone tell me what am i missing ..? – RBP Feb 04 '14 at 07:13

0 Answers0