> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.ragieai.core.GetDocumentContent

- Component: `appmixer.ragieai.core.GetDocumentContent`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.ragieai 1.1.4](https://connectors.appmixer.com/connector/appmixer.ragieai/1.1.4.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.ragieai/1.1.4/component/appmixer.ragieai.core.GetDocumentContent>

Get the content of a document. The mediaType parameter can be used to request the content in a different format. When requesting as application/json, additional metadata about the document will be included. If the original document contained content such as images or other non-textual media, this response will include a text description of that media instead of the original file data. Using mime types such as audio/mpeg or video/mp4 will stream the file in a format that can be provided to an audio/video player.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Document Id (`documentId`) | text | The id of the document. |
| Media Type (`mediaType`) | select | The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the document's type. |
| Download (`download`) | toggle | Whether to return the content as a file download or a raw stream. If set to true, the content will be returned as a named file for download. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Status (`status`) | string | - |
| Id (`id`) | string | - |
| Created At (`created_at`) | string | - |
| Updated At (`updated_at`) | string | - |
| Name (`name`) | string | - |
| Metadata (`metadata`) | object | - |
| Partition (`partition`) | string | - |
| Content (`content`) | string | - |
| File ID (`fileId`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.ragieai.core.GetDocumentContent",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Get the content of a document. The mediaType parameter can be used to request the content in a different format. When requesting as application/json, additional metadata about the document will be included. If the original document contained content such as images or other non-textual media, this response will include a text description of that media instead of the original file data. Using mime types such as audio/mpeg or video/mp4 will stream the file in a format that can be provided to an audio/video player.",
  "version": "1.0.0",
  "private": false,
  "auth": {
    "service": "appmixer:ragieai"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "documentId": {
            "type": "string"
          },
          "mediaType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "",
              "text/plain",
              "audio/mpeg",
              "video/mp4",
              "image/webp",
              "image/heic",
              "image/bmp",
              "image/png",
              "image/jpeg",
              "image/tiff",
              "application/json"
            ]
          },
          "download": {
            "type": "boolean"
          }
        },
        "required": [
          "documentId"
        ]
      },
      "inspector": {
        "inputs": {
          "documentId": {
            "type": "text",
            "tooltip": "The id of the document.",
            "label": "Document Id",
            "index": 0
          },
          "mediaType": {
            "type": "select",
            "tooltip": "The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the document's type.",
            "label": "Media Type",
            "index": 1,
            "options": [
              {
                "label": "Auto (use original)",
                "clearItem": true
              },
              {
                "label": "JSON (application/json)",
                "value": "application/json"
              },
              {
                "label": "Plain text (text/plain)",
                "value": "text/plain"
              },
              {
                "label": "Audio — MP3 (audio/mpeg)",
                "value": "audio/mpeg"
              },
              {
                "label": "Video — MP4 (video/mp4)",
                "value": "video/mp4"
              },
              {
                "label": "Image — WebP (image/webp)",
                "value": "image/webp"
              },
              {
                "label": "Image — HEIC (image/heic)",
                "value": "image/heic"
              },
              {
                "label": "Image — BMP (image/bmp)",
                "value": "image/bmp"
              },
              {
                "label": "Image — PNG (image/png)",
                "value": "image/png"
              },
              {
                "label": "Image — JPEG (image/jpeg)",
                "value": "image/jpeg"
              },
              {
                "label": "Image — TIFF (image/tiff)",
                "value": "image/tiff"
              }
            ]
          },
          "download": {
            "type": "toggle",
            "tooltip": "Whether to return the content as a file download or a raw stream. If set to true, the content will be returned as a named file for download.",
            "label": "Download",
            "index": 2
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Status",
          "value": "status",
          "schema": {
            "type": "string",
            "example": "working"
          }
        },
        {
          "label": "Id",
          "value": "id",
          "schema": {
            "type": "string",
            "example": "doc_abc123def456"
          }
        },
        {
          "label": "Created At",
          "value": "created_at",
          "schema": {
            "type": "string",
            "example": "2024-01-15T10:30:00Z"
          }
        },
        {
          "label": "Updated At",
          "value": "updated_at",
          "schema": {
            "type": "string",
            "example": "2024-01-16T08:00:00Z"
          }
        },
        {
          "label": "Name",
          "value": "name",
          "schema": {
            "type": "string",
            "example": "output.pdf"
          }
        },
        {
          "label": "Metadata",
          "value": "metadata",
          "schema": {
            "type": "object",
            "example": {
              "source": "crm",
              "customer_id": "cus_1042"
            }
          }
        },
        {
          "label": "Partition",
          "value": "partition",
          "schema": {
            "type": "string",
            "example": "default"
          }
        },
        {
          "label": "Content",
          "value": "content",
          "schema": {
            "type": "string",
            "example": "The document content text..."
          }
        },
        {
          "label": "File ID",
          "value": "fileId",
          "schema": {
            "type": "string",
            "example": "file_abc123"
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
