Hi, Julian, thanks for your reply.
I've already tried that code, but I don't know what I'm doing wrong.
I'm adding my code this time:
UserInputHelper inputController = new TwoLeggedOAuthUserInputHelper();
UserInputVariables variables = inputController.getVariables();
GoogleOAuthParameters oAuthParameters = new GoogleOAuthParameters();
oAuthParameters.setOAuthConsumerKey(variables.getConsumerKey());
oAuthParameters.setOAuthConsumerSecret(variables.getConsumerSecret());
oAuthParameters.setOAuthToken(tokenAcesso);
oAuthParameters.setOAuthTokenSecret(tokenSecret);
oAuthParameters.setScope("http://www.google.com/m8/feeds/");
oAuthParameters.setOAuthType(OAuthType.TWO_LEGGED_OAUTH);
OAuthSigner signer = new OAuthHmacSha1Signer();
GoogleOAuthHelper oAuthHelper = new GoogleOAuthHelper(signer);
ContactsService contactsService = new ContactsService(
"spread-testePainel-v1");
contactsService.setOAuthCredentials(oAuthParameters, signer);
contactsService.useSsl();
String url
=
"http://www.google.com/m8/feeds/contacts/<user>@domain.com/full?xoauth_requestor_id=<admin>@domain.com";
URL retrieveUrl = new URL(url);
ContactFeed feed = service.getFeed(retrieveUrl, ContactFeed.class);
public class TwoLeggedOAuthUserInputHelper extends UserInputHelper {
@Override
public UserInputVariables getVariables() {
UserInputVariables variables = new UserInputVariables();
variables.setGoogleService(getGoogleServiceType());
variables.setConsumerKey(getOAuthConsumerKey());
variables.setConsumerSecret(getConsumerSecret());
variables.setSignatureMethod(UserInputVariables.SignatureMethod.HMAC);
variables.setSignatureKey(getConsumerSecret());
variables.setVariable("xoauth_requestor_id", "[email protected]");
return variables;
}
}
Is there anything you can do to help me, please?
Thanks in advance,
Cindy de Albuquerque
--
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