What are the proper steps to download a Yahoo! Mail attachment using OAuth and PHP?

lfl

New member
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=547710480&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1294004462&oauth_token=A%3D3DNgwum2v6kTEaOwT.7.Wu5_yRRcbDpEoE8puBGp5GfnThawymsYGLxN4YFQ.dKMzhfkzBgd6CGeQwg9ga3kDpp56BMHJ_RLcrx74eFg2N6.vlqtUYgJWseKu7Xaa2dYgb9Ilp3IbselhemX7JZR2YwDgqcWCXPBvGprN8BFQDpDh4av7r4L60IXMrRBhRVOFbel8RfNbWZvMG4qcBEm_egvbyBVL4NV83WEaNqkWbsCXD6WYjP3ZPVo.it16XJFWuTG0KsZfpkBDxA48DCaoBGl351.ZEFgYUY5UhAo6k445hNqdlFp_gobZKWyy2RQV4e1ALU8jVl.l_TFjan4ePhN.RkvunN.yY3IcCbQAf.XzKfouzHzrHqvXjyrWn.QJmoqheygR9JtlGN4aUCCmbS9yjtSzcsqWH5cpFk4ewO.xxZrLMoiquW6Bj0VDfv4BdQHzG8gGIjSdUlQ7tfTq1F97ue6RlPBkR_LJFl5Pk2CoL_YYwpXicXAMM1dM_655gMC1XAa5LX75YRGtHVtqYq.5dSyM4AukcgxKQk7q0OkPwRdeRxMf8N_4jW4__BiJbd9ABJ5eWU5hqyhw3QiCBgDlhuexu2xgOyNP65ksqIUPPaErO2oZKHZPdUoN6uek7sAaB5Foj3qHGoM.JC4M1p96ymiZlL5qtvN7CmCszcVAkq8AtltCabZ1V0.8X_Luub_.LKN6atjfKGU90AD2bypHElOb72zoui98LixEgjMiY2SSNSf5YxRIMaWQJqTcGFi9Ver7nmGiEl4Ks9nM-&oauth_version=1.0&oauth_signature=hTQAkhr%2BY4MCdttUYgOro3%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%3D3DNgwum2v6kTEaOwT.7.Wu5_yRRcbDpEoE8puBGp5GfnThawymsYGLxN4YFQ.dKMzhfkzBgd6CGeQwg9ga3kDpp56BMHJ_RLcrx74eFg2N6.vlqtUYgJWseKu7Xaa2dYgb9Ilp3IbselhemX7JZR2YwDgqcWCXPBvGprN8BFQDpDh4av7r4L60IXMrRBhRVOFbel8RfNbWZvMG4qcBEm_egvbyBVL4NV83WEaNqkWbsCXD6WYjP3ZPVo.it16XJFWuTG0KsZfpkBDxA48DCaoBGl351.ZEFgYUY5UhAo6k445hNqdlFp_gobZKWyy2RQV4e1ALU8jVl.l_TFjan4ePhN.RkvunN.yY3IcCbQAf.XzKfouzHzrHqvXjyrWn.QJmoqheygR9JtlGN4aUCCmbS9yjtSzcsqWH5cpFk4ewO.xxZrLMoiquW6Bj0VDfv4BdQHzG8gGIjSdUlQ7tfTq1F97ue6RlPBkR_LJFl5Pk2CoL_YYwpXicXAMM1dM_655gMC1XAa5LX75YRGtHVtqYq.5dSyM4AukcgxKQk7q0OkPwRdeRxMf8N_4jW4__BiJbd9ABJ5eWU5hqyhw3QiCBgDlhuexu2xgOyNP65ksqIUPPaErO2oZKHZPdUoN6uek7sAaB5Foj3qHGoM.JC4M1p96ymiZlL5qtvN7CmCszcVAkq8AtltCabZ1V0.8X_Luub_.LKN6atjfKGU90AD2bypHElOb72zoui98LixEgjMiY2SSNSf5YxRIMaWQJqTcGFi9Ver7nmGiEl4Ks9nM-&mid=1_11785_AMvJjkQAAJJjTQgZpgDJg1E%2FJsk&fid=Inbox&pid=2&clean=0&inline=0&oauth_signature=ywvdvQ5fCPbee6a6Vh6GmEg0lYM%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.
 
Back
Top