---
updatedAt: 2026-02-12T14:06:00.000Z
agentTools:
  projectIndex: https://transport-freight-management.docs.developers.aeb.com/llms.txt
---

# getDocumentInstance

<h3>Download an existing document content</h3><p>Returns the document instance for the given reference object and document type.</p>

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Document Service HTTP API",
    "description": "Thank you for using our HTTP API documentation.",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://rz3.aeb.de/demo1docs/rest"
    }
  ],
  "security": [
    {
      "SWAGGER_AUTH_KEY": []
    },
    {
      "BASIC_AUTH": []
    }
  ],
  "tags": [
    {
      "name": "DocumentService",
      "description": "REST API for the Document Service"
    }
  ],
  "paths": {
    "/DocumentService/documentInstance/{referenceType}/{referenceNumber}/{documentType}": {
      "get": {
        "tags": [
          "DocumentService"
        ],
        "summary": "getDocumentInstance",
        "description": "<h3>Download an existing document content</h3><p>Returns the document instance for the given reference object and document type.</p>",
        "operationId": "getDocumentInstance",
        "parameters": [
          {
            "name": "referenceType",
            "in": "path",
            "description": "Document reference type",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "SHIPMENT"
          },
          {
            "name": "referenceNumber",
            "in": "path",
            "description": "Document reference number",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": 4711
          },
          {
            "name": "documentType",
            "in": "path",
            "description": "Document type",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "DEMODOC"
          },
          {
            "name": "contentVariant",
            "in": "query",
            "description": "Format of the document content",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "searchInArchive",
            "in": "query",
            "description": "Search archives if not found in common storage",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "description": "Downloadable document content",
                  "format": "binary"
                }
              }
            },
            "links": {
              "content via id": {
                "operationRef": "document/{documentId}",
                "parameters": {
                  "documentId": "String"
                },
                "description": "Download document content"
              },
              "content": {
                "operationRef": "documentInstance/{referenceType}/{referenceNumber}/{documentType}",
                "parameters": {
                  "referenceNumber": "String",
                  "documentType": "String",
                  "referenceType": "String"
                },
                "description": "Download document content"
              }
            }
          },
          "400": {
            "description": "Document content was not found or there were multiple contents stored",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "Reference object was not found",
            "content": {
              "application/json": {}
            }
          },
          "410": {
            "description": "Document has already expired",
            "content": {
              "application/json": {}
            }
          },
          "422": {
            "description": "Document instance was not created (missing document type or unprocessable data)",
            "content": {
              "application/json": {}
            }
          },
          "425": {
            "description": "Document content pending",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "SWAGGER_AUTH_KEY": {
        "type": "apiKey",
        "name": "X-XNSG_WEB_TOKEN",
        "in": "header"
      },
      "BASIC_AUTH": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-proxy-enabled": false,
  "x-readme": {
    "explorer-enabled": true
  }
}
```