For some time now, I have been trying unsuccessfully to download an attachment via Yahoo! Mail using various PHP OAuth libraries. I am able to download a list of messages, view message info, call contacts, but have not been able to get a header without errors so that an attachment (with a valid mid) can be downloaded.

I have posted several times in the YDN forums but have yet to get a response to my problem and from the research that I have done it appears that I am not the only person who has this problem.

I have the prerequisite steps working properly, which include getting the oauth_token, authenticating the user, and getting an access token.

For downloading the attachment, I have tried various means and below are my two most recent attempts:

1) I have created an authorization header, which does give me an error message of invalid signature (two different OAUTH libraries have been used), and the error message is vague as to what causes the "invalid_signature" error.

This is the URL:

http://mail.yahooapis.com/ws/mail/v1.1/jsonrpc?oauth_consumer_key=...&oauth_nonce=5477104 80&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1294004462&oauth_token=A%3D3D Ngwum2v6kTEaOwT.7.Wu5_yRRcbDpEoE8puBGp5GfnThawymsY GLxN4YFQ.dKMzhfkzBgd6CGeQwg9ga3kDpp56BMHJ_RLcrx74e Fg2N6.vlqtUYgJWseKu7Xaa2dYgb9Ilp3IbselhemX7JZR2YwD gqcWCXPBvGprN8BFQDpDh4av7r4L60IXMrRBhRVOFbel8RfNbW ZvMG4qcBEm_egvbyBVL4NV83WEaNqkWbsCXD6WYjP3ZPVo.it1 6XJFWuTG0KsZfpkBDxA48DCaoBGl351.ZEFgYUY5UhAo6k445h NqdlFp_gobZKWyy2RQV4e1ALU8jVl.l_TFjan4ePhN.RkvunN. yY3IcCbQAf.XzKfouzHzrHqvXjyrWn.QJmoqheygR9JtlGN4aU CCmbS9yjtSzcsqWH5cpFk4ewO.xxZrLMoiquW6Bj0VDfv4BdQH zG8gGIjSdUlQ7tfTq1F97ue6RlPBkR_LJFl5Pk2CoL_YYwpXic XAMM1dM_655gMC1XAa5LX75YRGtHVtqYq.5dSyM4AukcgxKQk7 q0OkPwRdeRxMf8N_4jW4__BiJbd9ABJ5eWU5hqyhw3QiCBgDlh uexu2xgOyNP65ksqIUPPaErO2oZKHZPdUoN6uek7sAaB5Foj3q HGoM.JC4M1p96ymiZlL5qtvN7CmCszcVAkq8AtltCabZ1V0.8X _Luub_.LKN6atjfKGU90AD2bypHElOb72zoui98LixEgjMiY2S SNSf5YxRIMaWQJqTcGFi9Ver7nmGiEl4Ks9nM-&oauth_version=1.0&oauth_signature=hTQAkhr%2BY4MCd ttUYgOro3%2B5CX0%3D


Full response headers are below:

Date: Sun, 02 Jan 2011 21:44:17 GMT
WWW-Authenticate: OAuth oauth_problem="signature_invalid", realm="yahooapis.com"
Content-Type: application/xml
Age: 0
Transfer-Encoding: chunked
Connection: keep-alive
Server: YTS/1.17.23

401 Authorization Required

2)

When trying to connect directly to download attachment the URL looks like this:

http://mail.yahooapis.com/ya/download/?oauth_nonce=1447840451&oauth_timestamp=1294004462 &oauth_version=1.0&oauth_signature_method=HMAC-SHA1&oauth_consumer_key=...&oauth_token=A%3D3DNgwu m2v6kTEaOwT.7.Wu5_yRRcbDpEoE8puBGp5GfnThawymsYGLxN 4YFQ.dKMzhfkzBgd6CGeQwg9ga3kDpp56BMHJ_RLcrx74eFg2N 6.vlqtUYgJWseKu7Xaa2dYgb9Ilp3IbselhemX7JZR2YwDgqcW CXPBvGprN8BFQDpDh4av7r4L60IXMrRBhRVOFbel8RfNbWZvMG 4qcBEm_egvbyBVL4NV83WEaNqkWbsCXD6WYjP3ZPVo.it16XJF WuTG0KsZfpkBDxA48DCaoBGl351.ZEFgYUY5UhAo6k445hNqdl Fp_gobZKWyy2RQV4e1ALU8jVl.l_TFjan4ePhN.RkvunN.yY3I cCbQAf.XzKfouzHzrHqvXjyrWn.QJmoqheygR9JtlGN4aUCCmb S9yjtSzcsqWH5cpFk4ewO.xxZrLMoiquW6Bj0VDfv4BdQHzG8g GIjSdUlQ7tfTq1F97ue6RlPBkR_LJFl5Pk2CoL_YYwpXicXAMM 1dM_655gMC1XAa5LX75YRGtHVtqYq.5dSyM4AukcgxKQk7q0Ok PwRdeRxMf8N_4jW4__BiJbd9ABJ5eWU5hqyhw3QiCBgDlhuexu 2xgOyNP65ksqIUPPaErO2oZKHZPdUoN6uek7sAaB5Foj3qHGoM .JC4M1p96ymiZlL5qtvN7CmCszcVAkq8AtltCabZ1V0.8X_Luu b_.LKN6atjfKGU90AD2bypHElOb72zoui98LixEgjMiY2SSNSf 5YxRIMaWQJqTcGFi9Ver7nmGiEl4Ks9nM-&mid=1_11785_AMvJjkQAAJJjTQgZpgDJg1E%2FJsk&fid=Inb ox&pid=2&clean=0&inline=0&oauth_signature=ywvdvQ5f CPbee6a6Vh6GmEg0lYM%3D

The header response is below:

Date: Sun, 02 Jan 2011 21:46:04 GMT
P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1
Age: 0
Transfer-Encoding: chunked
Connection: keep-alive
Server: YTS/1.17.23

404 Not Found

If someone could please help to steer me in the right direction, it would be appreciated.

Thank you.