0

How to extract GUID from response header

Hi Friends,
Am developing an Address Book import using yahoo. My development is of using OAuth method i got the authentication access token secret token successfully . But the last step is extracting xoauth_guid am very much confused how to extract this guid. My development is using java. It irritates me.

OAuthConsumer consumer = new
DefaultOAuthConsumer("consumer key***", "secret key****");
OAuthProvider provider = new
DefaultOAuthProvider("https://api.login.yahoo.com/oauth/v2/get_request_token",
"https://api.login.yahoo.com/oauth/v2/get_token",
"https://api.login.yahoo.com/oauth/v2/request_auth");
System.out.println("Fetching request token from Yahoo...");
String ss=OAuth.OAUTH_CALLBACK;
ss="resumelinkers.com/YahooLogin";
// we do not support callbacks, thus pass OOB
String authUrl = provider.retrieveRequestToken(consumer,ss);
System.out.println("Request token: " + consumer.getToken());
System.out.println("Token secret: " + consumer.getTokenSecret());
System.out.println("Now visit:\n" + authUrl
+ "\n... and grant this app authorization");
// System.out.println(x);
System.out.println("Enter the verification code and hit ENTER when you're done");
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
String oauthverifier = br.readLine();
System.out.println("Fetching access token from Yahoo...");
provider.retrieveAccessToken(consumer, oauthverifier);
HttpServletRequest request = null;
System.out.println("Access token: " + consumer.getToken());
System.out.println("Token secret: " + consumer.getTokenSecret());


I dont know how to extract guid please help me out of this hell.

3 Replies
  • Hi,

    Did you follow the guide on how to obtain GUID?
    http://developer.yahoo.com/social/rest_api...ices-guids.html

    You need to make sure that you can get the access token and
    the access token secret and then use it to sign your request to
    the get GUID API (http://social.yahooapis.com/v1/me/guid).

    The OAuth guide provides details on all the steps involved:
    http://developer.yahoo.com/oauth/guide/index.html

    Thanks,
    Yu Wang
    Yahoo! Membership Team
    0
  • Hi Yu Wang,
    Thanks for Your Kind reply. I have signed in with my request to get GUID in http://social.yahooapis.com/v1/me/guid but after signing in with my request i put this url (http://social.yahooapis.com/v1/me/guid) in my browser but i got this Error
    <yahoo:error xml:lang="en-US">

    <yahoo:description>
    Please provide valid credentials. OAuth oauth_problem="unable_to_determine_oauth_type", realm="yahooapis.com"
    </yahoo:description>
    </yahoo:error>

    <!--
    :bKamalakannan JS
    0
  • Hi,
    I got the GUID its Working thanks...

    Kamalakannan JS
    0

Recent Posts

in OAuth General Discussion YDN SDKs