Get Attachment by Ticket
This endpoint retrieves a file attachment associated with a specific support ticket. The caller must supply both the ticket ID and the exact file name to identify the attachment. The response includes the file content encoded in Base64 along with metadata such as content type and creation date.
Endpoint
GET /api/tickets/attachment
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when a partner application needs to download or display a file that was previously attached to a support ticket message. This is typically called after listing ticket messages to obtain the file names, then fetching the actual file content for rendering or storage.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticketId | integer (int32) | Yes | The unique identifier of the ticket associated with the attachment. |
| fileName | string | Yes | The name of the file attachment to retrieve. Must match the stored file name exactly. |
Response
200 OK
| Field | Type | Description |
|---|---|---|
| ticketMessageId | integer (int32), nullable | The ID of the ticket message to which this attachment belongs. |
| fileName | string, nullable | The stored name of the file as it exists in the system. |
| contentType | string, nullable | The MIME type of the file (e.g., image/png, application/pdf). |
| fileBase64 | string, nullable | The file content encoded as a Base64 string. Decode this to obtain the raw binary file. |
| createdDate | string (date-time) | The timestamp when the attachment was created. |
| originalFileName | string, nullable | The original file name as provided when the attachment was uploaded. |
{
"ticketMessageId": 4821,
"fileName": "attachment_4821_invoice.pdf",
"contentType": "application/pdf",
"fileBase64": "JVBERi0xLjQKJcfs...",
"createdDate": "2025-11-14T09:32:00Z",
"originalFileName": "invoice_october_2025.pdf"
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing or malformed ticketId or fileName query parameter |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to access this ticket's attachments |
| 404 | No attachment found for the given ticketId and fileName combination |
| 500 | Internal server error |
Common Mistakes
- Providing a
fileNamethat does not exactly match the stored file name (including casing and extension) will result in a 404 response. - Forgetting to decode the
fileBase64field before attempting to render or save the file — the field is Base64-encoded and must be decoded to obtain the raw binary content. - Using an expired Bearer token; tokens expire after 10 minutes and must be refreshed via
POST /api/auth/refreshbefore making calls. - Passing the
ticketIdas a string instead of an integer; the parameter expects an int32 value.
Related Endpoints
GET /api/tickets— List all support tickets for a customerGET /api/tickets/{ticketId}— Retrieve details of a specific support ticketPOST /api/tickets/attachment— Upload a new attachment to a ticket message
Example
curl -X GET "https://api.banking.netevia.dev/api/tickets/attachment?ticketId=4821&fileName=attachment_4821_invoice.pdf" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"