Hi, 
I have been trying to use OAuth2 and access a user's google contacts.

I followed example on google(which is for installed app but I changed it to 
use web app). it works fine until I try sending the access token to google 
contacts api, it returns me "400 Bad Request" error without meaning info.

I have tried auth play ground and confirmed that the access token is 
correct.

Can you please take a look at the following code, what change should I make 
?    

    // Make an authenticated request
    GenericUrl shortenEndpoint = new 
GenericUrl("https://www.google.com/m8/feeds/contacts/full";);
    HttpRequest request = rf.buildGetRequest(shortenEndpoint);
    GoogleHeaders headers = new GoogleHeaders();
    headers.setContentType("application/x-www-form-urlencoded");
    headers.setAuthorization("OAuth " + accessToken);    
    request.setHeaders(headers);    
    HttpResponse shortUrl = request.execute();     <---"400 error out"

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