Hi,
Thanks for your response.
As you said , i tried with wget ,and i am sending request and response.
Request:
===========================
wget -S -d 'http://social.yahooapis.com/v1/user/YOURGUID/contacts?format=json' --header='Authorization: OAuth realm="yahooapis.com",oauth_consumer_key="dj0yJmk9Nk1YdU55TWdiTjVkJmQ9WVdrOWNtbEJRVTVyTnpRbWNHbzlNVFV5TXpNeU56ZzJNZy0
tJnM9Y29uc3VtZXJzZWNyZXQmeD0yNA--",oauth_nonce="8613480710000001",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1274851673",oauth_token="A%3DrnJFuPnmiQ2sLoHFQ_IzQDkizQ1v_Z8G3c0FlxovCn.pr29ruNq.1UaDuBpxNCHMUkTAoqJNSokT59
T4eo6r.H5mDciwQLNrp_ZfomvPbEVZxSR7vt767Vo9EbFYCs39jOmKlRGgTNLJA8WQZjoG9shRRDEHfOO
ChbtDMrbauEV8EHjdpdci7OAFHmiSIHSx5IVX6eiOMpe2acQjkc71y8XpWpD.I2Hu75OkgCrZMcAWappL
c0UokZ7s6zmwy2KVWpDqHyYTRc8OisXiJsvO02uT4v9QeM7nExMdVPbqwcRr.WMV3KSImmYr59Kjd5_p2
5tVbjTeuIZskU5mCFJbPmS.UIVs9JoyJNkR9Q9K9Fs_IeptdeboFP0YSWinu.2xvBIb7W5GBhi1SDWbQe
6rLQvRY8x495dhMgVBjuCzziqu2rYpI2dyZ4PwmqRo4lRb6gVXz_QDzlUv4BnON5MOkUZvi4a7x.LgzOr
dZZ7TNCzKXyJN5P_a3VyNPXwNicfs9SsPrm8tYItPmcLHVgvMs3vdWVw49U4Xsu4j61GsufLf343.hFcv
iuhMx9djzDK3VWveEjeFGmyq3gFZQtNdEUNwYEEPL3mOzvWqE7azVaihwp7suw4djcOLmk1Dv_XyC2sWV
qQ92lhD2.Oiclomqxa6X6cSqcbOGGloGNRRl9DFlHM7Cjv0daTp73nsZ4tTJA5WAjKKpbuklaCx4A--",oauth_version="1.0",oauth_signature="9kqK14Cu1EN2IeIOY0bnF6L6GGc="'
=================================
Response:
=======================
Setting --header (header) to Authorization: OAuth realm="yahooapis.com",oauth_consumer_key="dj0yJmk9Nk1YdU55TWdiTjVkJmQ9WVdrOWNtbEJRVTVyTnpRbWNHbzlNVFV5TXpNeU56ZzJNZy0
tJnM9Y29uc3VtZXJzZWNyZXQmeD0yNA--",oauth_nonce="8613480710000001",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1274851673",oauth_token="A%3DrnJFuPnmiQ2sLoHFQ_IzQDkizQ1v_Z8G3c0FlxovCn.pr29ruNq.1UaDuBpxNCHMUkTAoqJNSokT59
T4eo6r.H5mDciwQLNrp_ZfomvPbEVZxSR7vt767Vo9EbFYCs39jOmKlRGgTNLJA8WQZjoG9shRRDEHfOO
ChbtDMrbauEV8EHjdpdci7OAFHmiSIHSx5IVX6eiOMpe2acQjkc71y8XpWpD.I2Hu75OkgCrZMcAWappL
c0UokZ7s6zmwy2KVWpDqHyYTRc8OisXiJsvO02uT4v9QeM7nExMdVPbqwcRr.WMV3KSImmYr59Kjd5_p2
5tVbjTeuIZskU5mCFJbPmS.UIVs9JoyJNkR9Q9K9Fs_IeptdeboFP0YSWinu.2xvBIb7W5GBhi1SDWbQe
6rLQvRY8x495dhMgVBjuCzziqu2rYpI2dyZ4PwmqRo4lRb6gVXz_QDzlUv4BnON5MOkUZvi4a7x.LgzOr
dZZ7TNCzKXyJN5P_a3VyNPXwNicfs9SsPrm8tYItPmcLHVgvMs3vdWVw49U4Xsu4j61GsufLf343.hFcv
iuhMx9djzDK3VWveEjeFGmyq3gFZQtNdEUNwYEEPL3mOzvWqE7azVaihwp7suw4djcOLmk1Dv_XyC2sWV
qQ92lhD2.Oiclomqxa6X6cSqcbOGGloGNRRl9DFlHM7Cjv0daTp73nsZ4tTJA5WAjKKpbuklaCx4A--",oauth_version="1.0",oauth_signature="9kqK14Cu1EN2IeIOY0bnF6L6GGc="
DEBUG output created by Wget 1.10.2 (Red Hat modified) on linux-gnu.
--05:30:50--
http://social.yahooapis.com/v1/user/YOURGU...cts?format=jsonResolving social.yahooapis.com... 68.142.215.20
Caching social.yahooapis.com => 68.142.215.20
Connecting to social.yahooapis.com|68.142.215.20|:80... connected.
Created socket 3.
Releasing 0x00000000015a3650 (new refcount 1).
---request begin---
GET /v1/user/YOURGUID/contacts?format=json HTTP/1.0
User-Agent: Wget/1.10.2 (Red Hat modified)
Accept: */*
Host: social.yahooapis.com
Connection: Keep-Alive
Authorization: OAuth realm="yahooapis.com",oauth_consumer_key="dj0yJmk9Nk1YdU55TWdiTjVkJmQ9WVdrOWNtbEJRVTVyTnpRbWNHbzlNVFV5TXpNeU56ZzJNZy0
tJnM9Y29uc3VtZXJzZWNyZXQmeD0yNA--",oauth_nonce="8613480710000001",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1274851673",oauth_token="A%3DrnJFuPnmiQ2sLoHFQ_IzQDkizQ1v_Z8G3c0FlxovCn.pr29ruNq.1UaDuBpxNCHMUkTAoqJNSokT59
T4eo6r.H5mDciwQLNrp_ZfomvPbEVZxSR7vt767Vo9EbFYCs39jOmKlRGgTNLJA8WQZjoG9shRRDEHfOO
ChbtDMrbauEV8EHjdpdci7OAFHmiSIHSx5IVX6eiOMpe2acQjkc71y8XpWpD.I2Hu75OkgCrZMcAWappL
c0UokZ7s6zmwy2KVWpDqHyYTRc8OisXiJsvO02uT4v9QeM7nExMdVPbqwcRr.WMV3KSImmYr59Kjd5_p2
5tVbjTeuIZskU5mCFJbPmS.UIVs9JoyJNkR9Q9K9Fs_IeptdeboFP0YSWinu.2xvBIb7W5GBhi1SDWbQe
6rLQvRY8x495dhMgVBjuCzziqu2rYpI2dyZ4PwmqRo4lRb6gVXz_QDzlUv4BnON5MOkUZvi4a7x.LgzOr
dZZ7TNCzKXyJN5P_a3VyNPXwNicfs9SsPrm8tYItPmcLHVgvMs3vdWVw49U4Xsu4j61GsufLf343.hFcv
iuhMx9djzDK3VWveEjeFGmyq3gFZQtNdEUNwYEEPL3mOzvWqE7azVaihwp7suw4djcOLmk1Dv_XyC2sWV
qQ92lhD2.Oiclomqxa6X6cSqcbOGGloGNRRl9DFlHM7Cjv0daTp73nsZ4tTJA5WAjKKpbuklaCx4A--",oauth_version="1.0",oauth_signature="9kqK14Cu1EN2IeIOY0bnF6L6GGc="
---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.0 401 Authorization Required
Date: Wed, 26 May 2010 05:30:50 GMT
WWW-Authenticate: OAuth oauth_problem="signature_invalid", realm="yahooapis.com"
Vary: Accept-Encoding
Content-Type: application/json
Age: 0
Connection: close
Via: HTTP/1.1 r5.ycpi.mud.yahoo.net (YahooTrafficServer/1.18.5 [cMsSf ])
Server: YTS/1.18.5
---response end---
HTTP/1.0 401 Authorization Required
Date: Wed, 26 May 2010 05:30:50 GMT
WWW-Authenticate: OAuth oauth_problem="signature_invalid", realm="yahooapis.com"
Vary: Accept-Encoding
Content-Type: application/json
Age: 0
Connection: close
Via: HTTP/1.1 r5.ycpi.mud.yahoo.net (YahooTrafficServer/1.18.5 [cMsSf ])
Server: YTS/1.18.5
hs->local_file is: contacts?format=json (not existing)
Closed fd 3
Authorization failed.
==============================================
I generated signature as follows
OAuthParameters oauthparams = new OAuthParameters();
oauthparams.setOAuthConsumerKey(CONSUMER_KEY);
oauthparams.setOAuthConsumerSecret(CONSUMER_SECRET);
oauthparams.setOAuthNonce(nonce);
oauthparams.setOAuthSignatureMethod("HMAC-SHA1");
oauthparams.setOAuthTimestamp(timestamp);
oauthparams.setOAuthToken(oauth_token);
oauthparams.setOAuthTokenSecret(oauth_token_secret);
oauthparams.setRealm("yahooapis.com");
OAuthHmacSha1Signer sgner = new OAuthHmacSha1Signer();
String signature = (sgner.getSignature(baseString, oauthparams));
oauthparams.setOAuthSignature(signature);
Is this correct way to generate signature. If not can you suggest me how to generate signature.
I have some doubt on my consumer secret i.e.
In my account it is showing as "74f8e3730329e2c0007d3680b9addeb1940ddf82" which is generated today.
My previous consumer secret is "bf31dc0efbb3200fec4359e389daad1fdf2e7735".
If i use new consumer secret ,it is saying signature invalid for request token,access token.
If i use old consumer secret , i am able to get request token and access token.
Which one is my consumer secret ,whether it is old one or new one?
And how generate signature for accessing yahoo contact API?
Please suggest me.
Thanks in Advance