Get attachment by ticket

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

ParameterTypeRequiredDescription
ticketIdinteger (int32)YesThe unique identifier of the ticket associated with the attachment.
fileNamestringYesThe name of the file attachment to retrieve. Must match the stored file name exactly.

Response

200 OK

FieldTypeDescription
ticketMessageIdinteger (int32), nullableThe ID of the ticket message to which this attachment belongs.
fileNamestring, nullableThe stored name of the file as it exists in the system.
contentTypestring, nullableThe MIME type of the file (e.g., image/png, application/pdf).
fileBase64string, nullableThe file content encoded as a Base64 string. Decode this to obtain the raw binary file.
createdDatestring (date-time)The timestamp when the attachment was created.
originalFileNamestring, nullableThe 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

CodeWhen it happens
400Missing or malformed ticketId or fileName query parameter
401Token missing, expired, or invalid
403Insufficient permissions to access this ticket's attachments
404No attachment found for the given ticketId and fileName combination
500Internal server error

Common Mistakes

  • Providing a fileName that does not exactly match the stored file name (including casing and extension) will result in a 404 response.
  • Forgetting to decode the fileBase64 field 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/refresh before making calls.
  • Passing the ticketId as a string instead of an integer; the parameter expects an int32 value.

Related Endpoints

  • GET /api/tickets — List all support tickets for a customer
  • GET /api/tickets/{ticketId} — Retrieve details of a specific support ticket
  • POST /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"
Query Params
int32
string
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json