Free setup on annual plans

Sign up today!

API Reference: File endpoint

The File API exposes the public download route for stored ticket-message attachments. It does not upload, list or delete attachments. Those management operations belong to the TicketMessages endpoints; the File route only resolves an attachment access token and streams the stored file bytes.

Overview

Each ticket-message attachment has an accessToken GUID. When a client requests /api/File/{accessToken}, AnswerPal looks up the attachment by token and returns the file data with the stored content type. The endpoint is intentionally anonymous so attachment links can be embedded in chat, email, screenshots and generated message content without a representative JWT.

Current endpoint

Tokenized download

  • GET /api/File/{accessToken:guid} – Public
    Download or inline-render one ticket-message attachment by its access token. The route parameter must be a GUID. The response body is binary file data, not JSON.

Inline and attachment responses

  • Inline response types
    image/png, image/jpeg, image/gif, image/webp, image/svg+xml, application/pdf and text/plain are returned without a download filename so the browser can display them inline.
  • Download response types
    All other content types are returned with the stored filename, so ASP.NET Core sends them as file downloads.
  • Fallback values
    If an attachment lacks metadata, the endpoint falls back to application/octet-stream and download.bin.

Attachment management lives in TicketMessages

  • GET /api/TicketMessages/{id}/attachments – TicketAccess
    List attachment metadata for a ticket message. This returns TicketMessageAttachmentDTO records with accessToken values but not fileData.
  • POST /api/TicketMessages/{id}/attachments – TicketAccess
    Upload a new attachment as multipart/form-data field file. The upload limit is 50 MB; request body limit is 60 MB.
  • DELETE /api/TicketMessages/{id}/attachments/{attachmentId} – TicketAccess
    Delete an attachment and converted derivatives for a ticket message.

Access model

  • Public by token
    GET /api/File/{accessToken:guid} is marked Public. Possession of the GUID token is what grants file access.
  • No listing by token
    The File endpoint cannot enumerate attachments and cannot return metadata for arbitrary tokens. Use TicketMessages endpoints under authenticated ticket access for management operations.
  • Token lifecycle
    The File endpoint reads the current attachment row. If the attachment is deleted, the token no longer resolves.
  • Bearer JWT elsewhere
    Protected AnswerPal API endpoints use JWT Bearer authentication. Attachment upload, listing and deletion require ticket access through TicketMessages endpoints.

Fields and DTOs

Attachment fields

Fields used by the File endpoint

  • accessToken
    GUID used as the route parameter for GET /api/File/{accessToken:guid}.
  • fileData
    Stored bytes streamed in the response body. This field is never returned in TicketMessageAttachmentDTO metadata.
  • contentType
    Stored MIME type used as the response Content-Type. Defaults to application/octet-stream when missing.
  • fileName
    Stored filename used for non-inline downloads. Defaults to download.bin when missing.

Attachment metadata fields returned by TicketMessages

  • ticketMessageAttachmentID, messageID
    Attachment identity and owning ticket message.
  • fileName, contentType, fileSizeBytes, createdDateTime
    Metadata used by clients before constructing download links.
  • isEndUserProvided, isCustomerRepProvided, convertedFromAttachmentID, contentId
    Source, conversion and inline-message metadata.
  • accessToken
    Token clients append to https://api.answerpal.eu/api/File/ to retrieve the binary file.

Status codes

  • 200 OK
    The token resolves to an attachment and the endpoint returns binary file content.
  • 404 Not Found
    No attachment exists for the supplied token, or the URL does not match the GUID route constraint.
  • No 401/403 for this endpoint
    The File route itself is anonymous. Authorization applies when obtaining attachment metadata or uploading/deleting files through TicketMessages.

Examples and scenarios

Download URL from an access token

GET https://api.answerpal.eu/api/File/11111111-2222-3333-4444-555555555555

Use attachment metadata to build a link

GET /api/TicketMessages/987/attachments
Authorization: Bearer <token>

[
  {
    "ticketMessageAttachmentID": 41,
    "messageID": 987,
    "fileName": "invoice.pdf",
    "contentType": "application/pdf",
    "fileSizeBytes": 58214,
    "accessToken": "11111111-2222-3333-4444-555555555555"
  }
]

Download or view:
https://api.answerpal.eu/api/File/11111111-2222-3333-4444-555555555555
  • Inline preview
    A PDF, image or text attachment opens directly in the browser because its MIME type is in the inline allow-list.
  • Attachment download
    A spreadsheet, archive or unknown binary file is returned with its stored filename for download.
  • Embedded generated content
    Generated screenshots and message content can reference https://api.answerpal.eu/api/File/{accessToken} without requiring a logged-in representative session.

Table of Contents

AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.

Contact

For all support, sales, and partnership inquiries, email us at info@answerpal.eu

AnswerPal
Bisschoppenhoflaan 380
2100 Antwerp
Belgium

+32.36416685

BE 0862.692.858