---
updatedAt: 2026-08-30T09:50:43.000Z
agentTools:
  projectIndex: https://developer.unimaze.com/llms.txt
---

# Get document (by name)

Returns the binary payload of a document stored in a specific message using the name of the document.

Each message attachment has a unique name in the context of the message.

The document name can be found through the [`GET /messages/:mid`](https://developer.unimaze.com/reference/MessageGetById) call.

The name corresponds to the `name` property of each document in the `documents` array of the returned message object.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "MAPI Messaging v1.0",
    "description": "<p>\n  <img src=\"https://files.readme.io/a8b41579878c59e9773979bad07ed2937a4aeb67c1a217a34cffdcdda1e274a5-dev-docs-migration.png\"\n       alt=\"Dev Docs – Under Construction\"\n       width=\"420\"/>\n</p>\n\n## 🚧 Documentation has moved!\n\n|  |  |\n|---|---|\n| The MAPI documentation is now available on our new developer portal:<br><br>👉 **[https://developer.unimaze.com](https://developer.unimaze.com)** | • You’ll find up-to-date guides, authentication details, integration instructions, and client generation guidance there.<br><br>• This Swagger UI remains available for API exploration and testing, but the new developer portal is now the primary source of truth.<br><br>• The new site will provide a better Developer Experience for testing. |\n",
    "termsOfService": "https://www.unimaze.com/terms-of-use/",
    "contact": {
      "name": "Unimaze Software",
      "url": "https://www.unimaze.com",
      "email": "info@unimaze.com"
    },
    "license": {
      "name": "Unimaze Software",
      "url": "https://www.unimaze.com"
    },
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://mapi-sandbox.unimaze.com",
      "description": "SANDBOX"
    },
    {
      "url": "https://mapi-dsp-uat.unimaze.com",
      "description": "UAT"
    },
    {
      "url": "https://mapi-partner-qa.unimaze.com",
      "description": "QA"
    }
  ],
  "paths": {
    "/api/v1/messages/{id}/documents/{name}": {
      "get": {
        "tags": [
          "Message"
        ],
        "summary": "Get document (by name)",
        "description": "Returns the binary payload of a document stored in a specific message using the name of the document.",
        "operationId": "GetMessageDocumentByName",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier of the message in the format of a valid Universally unique identifier (GUID).",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "The unique name of the attachment contained in the message.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "byte"
                }
              },
              "application/xml": {
                "schema": {
                  "type": "string",
                  "format": "byte"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood but could not be processed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleHttpErrorResult"
                },
                "example": {
                  "statusCode": "422",
                  "statusText": "UnprocessableEntity",
                  "message": "Message could not be processed. Missing lines."
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleHttpErrorResult"
                },
                "example": "<SimpleHttpErrorResult xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n  <StatusCode>422</StatusCode>\r\n  <StatusText>UnprocessableEntity</StatusText>\r\n  <Message>Message could not be processed. Missing lines.</Message>\r\n</SimpleHttpErrorResult>"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SimpleHttpErrorResult": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "string",
            "nullable": true
          },
          "statusText": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "nullable": true
          }
        },
        "additionalProperties": {}
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "The Messaging API supports **Bearer authentication** as defined in\r\n[RFC 6750](https://datatracker.ietf.org/doc/html/rfc6750).\r\n\r\nTo authenticate requests, include an API token in the `Authorization` header:\r\n\r\n`Authorization: Bearer {token}`\r\n\r\nThe token is an opaque value (Base64-encoded GUID) and must be treated as a\r\ncredential. Anyone in possession of the token is granted access.",
        "scheme": "bearer",
        "bearerFormat": "Opaque"
      },
      "Basic": {
        "type": "http",
        "description": "⚠ **Legacy authentication method**\r\n\r\nThe Messaging API historically supported **HTTP Basic Authentication** as defined in\r\n[RFC 7617](https://datatracker.ietf.org/doc/html/rfc7617).\r\n\r\nTo authenticate requests, include a username and password encoded using\r\nBase64 in the `Authorization` header.\r\n\r\nThis method is retained for backward compatibility only and **must not be used\r\nfor new integrations**. New consumers should use **Bearer authentication** instead.",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "Bearer": []
    },
    {
      "Basic": []
    }
  ]
}
```