0

Succ Wrked Yahoo Contacts

HI..
I got the contacts Successfully

If u have to get u have to get the console like this..Hope it may help u..

U will get the response from yahoo like this
{oauth_expires_in=3600, oauth_authorization_expires_in=872618929, oauth_token_secret=66010cfec37f5b1121a6c18869bd30bd037824ac, oauth_session_handle=AG6dzkvNFiwHTLHGkoAq.NqnOogQHCBmq2M0UEI9xFu9bzIPIZU-, xoauth_yahoo_guid=QJDSW7OMO4XUM7PHUPD3YMKUKM,

oauth_token=A%3D1r_o0i7njjnX.ZY.....{hidden for clear view}.....HfKRxOYdCwqS1h}

after decode oauth_token= A=1r_o0i7njjnX.Z.....{hidden for clear view} ......CwqS1h

with the decode u have to create base signature
while creating base String u must follow alphabetic order i.e

oaup.setOAuthConsumerKey(key);
oaup.setOAuthNonce(OAuthUtil.getNonce());
oaup.setOAuthSignatureMethod("HMAC-SHA1");
oaup.setOAuthTimestamp(OAuthUtil.getTimestamp());
oaup.setOAuthToken(URLDecoder.decode(accMap.get("oauth_token"),"utf-8")); //any encoding method u can use "ustf-8"

u have to create the base string with version.version must be encode like this %26oauth_version%3D1.0

base string will be look like this

Base String GET&http%3A%2F%2Fsocial.yahooapis.com%2Fv1%2Fuser%2FQJDSW7OMO4XUM7PHUPD3YMKUKM%2Fcontacts%3Bcount%3Dmax&oauth_consumer_key%3Ddj0yJ.....{hidden for seq}...k1qWXQ5%26oauth_nonce%3D20771471391078%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1274864453%26oauth_token%3DA%253D1r_o0i7njjn.....{hidden for clear view}......qS1h%26oauth_version%3D1.0

with this base string u have to create signature...form consumer secret,token secret

Signature after Encode Tfl1PIz0ygajusoyXohUQfr0hJA%3D

All of this information can sen to headers i Used Headers

Authorization: OAuth
realm="http%3A%2F%2Fyahooapis.com%2F",
oauth_consumer_key="dj0yJmk9TVIyQ.........{Hidden for Seq}.................dCZ4PWQ5",
oauth_nonce="20771471391078",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1274864453",
oauth_token="A%3D1r......{Hiden for clear view}.....wqS1h",
oauth_version="1.0",
oauth_signature="Tfl1PIz0ygafisAyXohUQfr0hJA%3D"

Hope this may works for u

by
2 Replies
  • signature was modify....by mistake...
    0
  • Hi,

    I am trying to get yahoo contacts in the same manner as you. but i am unable to fetch yahoo contacts.

    Can you please share some information regarding this issue.

    My base string is

    *GET&http%3A%2F%2Fsocial.yahooapis.com%2Fv1%2Fuser%2FUMGWPDQHM7O4X6ZQO7GDBHM6CU%2Fcontactsformat%3Djsonoauth_consumer_key%3Ddj0yJmk9Nk1YdU55TWdiTjVkJmQ9WVdrOWNtbEJRVTVyTnpRbWNHbzlNVFV5TXpNeU56ZzJNZy0tJn
    M9Y29uc3VtZXJzZWNyZXQmeD0yNA--%26oauth_nonce%3D9131765280000000%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1275369951%26oauth_token%3DA%3DrshP66GetBxadqUIVGIX5nW2vcmWPGduTYLl5COzasJwUZ7bY_drkdPRyO8d01pL3AmPZkAqU_Asdn
    ZyLwvmRZxCCREqPZdPJ7vl96LvZ_.fSz0d37ATeLXAEgdYZ9qCxyr3ifTxX0Pha_rNz.BweMMHagtSGJp
    6UWknfyFmRsj2SaoaSCQB.tM.xkQilvQ7n3PBRbSIIFRXvZFA9Te8KBgV8uPZJxMmS2RiSFD918xvg18P
    ZtmL5ike_XqQujv8xCxvt7e7OTi8X8bNbapay7s1WFQ3NXN1SzyTxwTC9FNK6IzOOR02zIlPDSMg0vYg.
    XKZwyrorUD3wE.gCJBZebo0gbqIoJ09iZLI3X6mNXvMVg5hhVFmimTDfkIq4Xx1vMgfwD7sd7HK9jZoul
    6uWZuzmoa9eTKIV4TK1uojmpeYxrn6baR6_672ToPN_xIK0Ji50P5Mg2YMdlGNcehh3qgVPRbH.3i9aaA
    wNty9RUm8d9NBXRt8QTevxeRC12BArVu8kAY2jPpFini5UV9TA6VkIV_qXYkqh7SvSJ6Pwwr5ceMmJQ3d
    cbjvayqAwaD4l6U_cXs0Nap3i67WZr2NFAMdqkmlf6QDYY9JAvAwssZOup.78zdKJg1AS6QHsB7SnqnQV
    Kuu72slOH.AmHuhkez35PW7vKp2btF3hmCaMHqpMQw5Y__PISYNLXMA_5kaxIrQ5HE-%26oauth_version%3D1.0



    I generated signature in following ways .

    1)
    OAuthParameters oauthparams = new OAuthParameters();
    oauthparams.setOAuthConsumerKey(CONSUMER_KEY);
    oauthparams.setOAuthNonce(nonce);
    oauthparams.setOAuthSignatureMethod("HMAC-SHA1");
    oauthparams.setOAuthTimestamp(timestamp);
    oauthparams.setOAuthToken(oauth_token);
    oauthparams.setRealm("yahooapis.com");



    OAuthHmacSha1Signer sgner = new OAuthHmacSha1Signer();
    String signature = (sgner.getSignature(baseString, oauthparams));


    2) String key = URLEncoder.encode(CONSUMER_SECRET)+"&"+URLEncoder.encode(oauth_token_secret);

    String signature = Signature.calculateRFC2104HMAC(baseString,key);

    signature = URLEncoder.encode(signature)


    can you please tell me, where i am doing wrong.

    Thanks in advance
    0

Recent Posts

in Contacts