DownloadAttachment
DownloadAttachment downloads a file attached to a
message. Anti-virus scanning can be performed and an error will be
returned if a virus is detected.
Available to premium accounts only.
Endpoints
http://mail.yahooapis.com/ya/download
Virus Scanning Endpoint
http://mail.yahooapis.com/ya/avscan
Parameters
Query string arguments.
Yahoo! Mail New Style
| Name | Description |
|---|---|
| fid | ID of the folder containing the message. |
| mid | New style message ID of the message containing the attachment. |
| pid | ID of the specific part to download. |
| tnef (optional) | Index of an individual attachment within a TNEF attachment (winmail.dat). |
| clean | If set to 1, the attachment needs scanning because it may have a virus. If set to 0, no scanning is required. |
| inline | If set to 1, download as inline. No content disposition is set in this case. |
| redirectURL | If a redirectURL is provided, and an error is encountered while downloading, the request is sent to the redirect URL with
an error code. If not provided, HTTP error codes are returned.
If while scanning it turns out that the attachment has a virus that cannot be cleaned, we do not send back a download URL. |
Error Codes
Virus scanning related error codes:
| Error Code | Meaning |
|---|---|
| download_av_internal_error | Internal error. |
| download_av_error | Virus was detected. |
| download_av_no_virus | Attachment does not have a virus. |
| download_has_virus_cant_clean | Attachment has a virus that can’t be cleaned. |
| download_cleaned | Attachment had a virus and was cleaned. |
| download_not_scannable | Attachment is not virus scannable. |
| download_av_server_down | Server is down. |
| download_has_virus | Attachment has a virus. |
Other
Possible errors and their HTTP responses when no redirect URL is provided:
| Error Code | HTTP Response | Meaning |
|---|---|---|
| invalid_cookies | 404 | Invalid cookies |
| could_not_open_udb | 500 | Server error. |
| no_credentials | 404 | No credentials. |
| cred_decrypt_failed | 404 | Failed to decrypt credentials. |
| mailbox_open_err | 404 | Could not open mailbox. |
| tnef_not_found | 404 | tnef attachment not found. |
| bad_tnef_param | 404 | tnef attachment does not exist for that parameter. |
| part_not_found | 500 | Part not found. |
| redirect_url_missing | 500 | Redirect URL is missing. |
| internal_error | 500 | Internal error. |
| attachment_not_found | 500 | Attachment not found. |

