Retrieve the prepared suppression file
const url = 'https://mailer-api.optizmo.net/accesskey/getfile/m-a12-a92b82cd3848ef7810d9ef0e?dcma=<dcma>&token=<token>';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://mailer-api.optizmo.net/accesskey/getfile/m-a12-a92b82cd3848ef7810d9ef0e?dcma=<dcma>&token=<token>'Use the download_link returned by
Prepare a suppression list download
to download the suppression list ZIP file. That link already has the
token and dcma query parameters embedded — make a GET to it as-is
rather than constructing the request yourself.
Note: Requests must handle and follow 3XX responses. For example curl requests should use the
-L, --locationflag.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The Mailer Access Key (MAK) from the download_link. Use the value
provided in the prepare-download response rather than constructing
it yourself.
Query Parameters
Section titled “Query Parameters”Opaque download token supplied in the download_link. Use the value
from that link as-is.
Responses
Section titled “ Responses ”Returned when the file cannot be retrieved — for example an invalid
token or dcma, when the download has not been prepared yet, when
a campaign move replaced the Mailer Access Key since the download
was prepared (access_key_replaced: get the new key from the
tracking platform that issued the old one; it answers before any
refusal except an invalid token), when the key’s campaign is on a
linked list but no move replaced the key (input_error with
key_replaced_by_move: false: no new key was sent, so ask the
network or advertiser that gave you the campaign), or when the
campaign has moved to another opt-out list since the download was
prepared (download_list_moved: prepare the download again, then
fetch the new download_link). The body is a JSON error response
whose error_code identifies the problem.
Error response returned when a request fails.
object
Always error for a failed response.
Error code. access_key_replaced: a campaign move replaced the
Mailer Access Key you sent, so get the new key from the tracking
platform that issued the old one. download_list_moved: the
campaign moved to another opt-out list since the download was
prepared, so the prepared file is for the list it has left; prepare
the download again. input_error with key_replaced_by_move: false:
the key’s campaign is on a linked list but no move replaced the key,
so no new key was sent.
Present, and false, only on an input_error answer for a key
whose campaign is on a linked list that no move replaced. Absent
from every other error response.
Title of the error.
Detailed description of error with help on how to resolve it.
Examples
File requested before it was prepared
{ "result": "error", "error_code": "download_not_prepared", "error": "This list has not been prepared for download.", "help": "Prepare the file first by calling GET /accesskey/download/{mailer_access_key}?token=YOUR_TOKEN, then request the download_link returned in that response (a /accesskey/getfile URL that includes a 'dcma' token)."}The campaign moved to another opt-out list after the download was prepared
{ "result": "error", "error_code": "download_list_moved", "error": "This campaign has moved to another opt-out list since this download was prepared, so the prepared file is for the list it has left. Prepare the download again by calling: https://mailer-api.optizmo.net/accesskey/download/{mailer_access_key}?token=redacted (replace 'redacted' with your token), then fetch the download_link it returns."}A campaign move replaced the key
{ "result": "error", "error_code": "access_key_replaced", "error": "The advertiser has changed the access to this campaign. You will need to go back to your tracking system to receive your new access key to this campaign. If it is not there yet, ask the network or advertiser that gave you this campaign; they have been sent the new key."}The key's campaign is on a linked list, but no move replaced the key
{ "result": "error", "error_code": "input_error", "key_replaced_by_move": false, "error": "The advertiser has changed the access to this campaign. You will need to go back to your tracking system to receive your new access key to this campaign."}The suppression file is ready. The response redirects (via the
Location header) to a signed URL where the ZIP file can be
downloaded. Requests must handle and follow 3XX responses.
For example curl requests should use the -L, --location flag.
Examples
A redirect to the prepared file
You should be redirected to the download file at https://...Headers
Section titled “Headers”Signed URL the suppression list ZIP can be downloaded from.
