| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Get Attachment by ID
Retrieves the binary content of a single ticket attachment, returned as a Base64-encoded string along with the original filename and MIME type. Use this endpoint when you need to download or display a specific document that was previously attached to a ticket.
Endpoint
GET /api/v1/tickets/getAttachmentById
Authentication
Basic HTTP Authentication required.
Encode username:password in Base64 and pass in the Authorization header:
Authorization: Basic {base64(username:password)}
When to use
Use this endpoint to retrieve the actual file content of an attachment — for example, to download a voided check, processing statement, or compliance document that was uploaded to a ticket. First call GET /api/v1/tickets/getAttachmentsByTicketId to obtain the attachment ID, then use this endpoint to fetch the file content.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer (int32) | Yes | Merchant profile ID associated with the ticket. |
ticketId | integer (int32) | Yes | ID of the ticket the attachment belongs to. |
attachId | integer (int32) | Yes | ID of the specific attachment to retrieve. |
Response
200 OK
| Field | Type | Description |
|---|---|---|
data.content | string (byte) | Base64-encoded file content. Decode to obtain the raw binary. |
data.fileName | string | Original filename including extension (e.g., voided_check.pdf). |
data.mimeType | string | MIME type of the file (e.g., application/pdf). |
requestId | integer | Internal request tracking ID. |
success | boolean | true if the attachment was retrieved successfully. |
error | string | Error message if the operation failed. |
validationErrors | array | List of field-level validation issues. |
{
"data": {
"content": "JVBERi0xLjQKJcfs4AAQSkZjRgABAQAAAQABAAD...",
"fileName": "voided_check.pdf",
"mimeType": "application/pdf"
},
"requestId": 98126,
"success": true,
"error": null,
"validationErrors": []
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing or invalid query parameters (id, ticketId, or attachId). |
| 401 | Invalid or missing Basic Auth credentials. |
| 403 | User does not have permission for this operation. |
| 404 | Ticket or attachment not found for the given IDs. |
| 500 | Internal server error. |
Common Mistakes
- Confusing
id(merchant profile ID) withattachId(attachment ID) — all three parameters are distinct and required. - Using an
attachIdfrom a different ticket — each attachment ID is scoped to its parent ticket. - Not decoding the Base64
contentfield before attempting to open or display the file. - Calling this endpoint without first listing attachments via
getAttachmentsByTicketIdto confirm the attachment exists.
Related Endpoints
GET /api/v1/tickets/getAttachmentsByTicketId— List all attachment metadata for a ticket to obtain validattachIdvalues.POST /api/v1/tickets/attachment— Upload a new attachment to a ticket.GET /api/v1/tickets/getTicketById— Retrieve ticket details including thehasAttachmentflag.
Example
curl -X GET "https://hq.staging.netevia.dev/api/v1/tickets/getAttachmentById?id=70269&ticketId=48291&attachId=1034" \
-H "Authorization: Basic $(echo -n 'username:password' | base64)"