---
title: Get the content of an archived mailing
slug: campaign/api/get-the-content-of-an-archived-mailing
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "t9QUADiaHS9k-so1ZKTKK",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/mailarchive/{bmMailId}/content",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/mailarchive/{bmMailId}/content"
      }
    ],
    "name": "Get the content of an archived mailing",
    "description": "<p>Get the content of an archived mailing. You can retrieve the content as EML or HTML file, and optionally compress the mailing to save space.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "string",
          "description": "Client ID"
        },
        {
          "kind": "required",
          "name": "bmMailId",
          "type": "string",
          "description": ""
        }
      ],
      "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"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "mailFormat",
          "type": "string",
          "description": "<p>File type of the retrieved mailingDefault value : EML</p>",
          "enum": [
            "EML",
            "HTML"
          ]
        },
        {
          "kind": "optional",
          "name": "compressed",
          "type": "boolean",
          "description": "<p>Compress the mailing to save spaceDefault value : false</p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The archived mailing was retrieved successfully.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "The bmMailId is invalidly encoded.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "The bmMailId could not be found in the mail archive.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "The indicated bmMailId is not assigned to the indicated client. Ensure that \"clientId\" and \"bmMailId\" are correct and that \"bmMailId\" is assigned to the indicated client.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "IcyGkTKcDvK6PAy2YenaV",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/mailarchive/{bmMailId}/content \\\n     --header 'accept: application/octet-stream'"
        },
        {
          "id": "Y_v-K5ntqL1BpTS69UK5K",
          "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/{bmMailId}/content\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "PK_ulqA2iIqYBAgByvfNn",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/mailarchive/{bmMailId}/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": "SFIj7LfQom5zOCNsztlG8",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/mailarchive/{bmMailId}/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": "IcyGkTKcDvK6PAy2YenaV"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The archived mailing was retrieved successfully.\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The bmMailId is invalidly encoded.\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// The bmMailId could not be found in the mail archive.\n"
        },
        {
          "id": "response-3-409",
          "language": "409",
          "code": "// The indicated bmMailId is not assigned to the indicated client. Ensure that \"clientId\" and \"bmMailId\" are correct and that \"bmMailId\" is assigned to the indicated client.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}