---
title: Get compressed file with archived mailing contents
slug: campaign/api/get-compressed-file-with-archived-mailing-contents
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "_gAqU8yIuls_f1Z10owlC",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/mailarchive/content",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/mailarchive/content"
      }
    ],
    "name": "Get compressed file with archived mailing contents",
    "description": "Get compressed file with archived mailing contents.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "string",
          "description": "Client ID"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/octet-stream",
            "application/vnd.optivo.broadmail.v1+json"
          ],
          "default": "application/octet-stream"
        },
        {
          "kind": "optional",
          "name": "next-cursor",
          "type": "string",
          "description": "Cursor to retrieve next batch. Cursor is going to expire after 10 minutes."
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "from",
          "type": "string",
          "description": "<p>Time filter to select archived mails created from date. DateTimeFormat 2021-11-07 17:43</p><div></div>. UTC Timezone will be used to parse the parameter<p></p>"
        },
        {
          "kind": "optional",
          "name": "bmMailIds",
          "type": "array",
          "description": "Collection of encoded mail IDs",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "optinStatus",
          "type": "string",
          "description": "<p>Double Opt-in status (Only for confirmation archived mails)</p>",
          "enum": [
            "non_confirmed",
            "confirmed"
          ]
        },
        {
          "kind": "optional",
          "name": "mailingId",
          "type": "integer<int64>",
          "description": "Mailing ID of archived mail",
          "format": "int64"
        },
        {
          "kind": "optional",
          "name": "recipientId",
          "type": "string",
          "description": "<p>Recipient ID (usually the email address)</p>"
        },
        {
          "kind": "optional",
          "name": "mailingTypes",
          "type": "string",
          "description": "<p>Collection of mailingTypes. Supported mailingTypes [event, transaction, confirmation, campaign]</p>"
        },
        {
          "kind": "optional",
          "name": "recipientAddress",
          "type": "string",
          "description": "<p>Recipient address (usually the email address)</p>"
        },
        {
          "kind": "optional",
          "name": "until",
          "type": "string",
          "description": "<p>Time filter to select archived mails created until date. DateTimeFormat 2021-11-07 17:43</p><div></div>. UTC Timezone will be used to parse the parameter<p></p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The compressed file with archived mailing contents was retrieved successfully.",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "next-cursor",
            "type": "integer",
            "description": "Cursor to retrieve next batch. Cursor is going to be expired after 10 minutes."
          }
        ]
      },
      {
        "statusCode": "204",
        "description": "Archived mailings could not be found.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "<p>Invalid request or 'next-cursor' is expired.</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/mailarchive/content \\\n     --header 'accept: application/octet-stream'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/octet-stream\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.campaign.episerver.net/rest/{clientId}/mailarchive/content\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/mailarchive/content\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/octet-stream\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/mailarchive/content\"\n\npayload = {}\nheaders = {\n   'accept': 'application/octet-stream',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The compressed file with archived mailing contents was retrieved successfully.\n"
        },
        {
          "id": "response-1-204",
          "language": "204",
          "code": "// Archived mailings could not be found.\n"
        },
        {
          "id": "response-2-400",
          "language": "400",
          "code": "// Invalid request or 'next-cursor' is expired.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}