getAttachment

Overview

This method returns an existing attachment.

To obtain the attachment's binary contents, you can:

  • forward the client to the URL returned by the getAttachmentPresignedUrl API (recommended if applicable)

  • capture the binary stream from the URL returned by the getAttachmentPresignedUrl API

  • call this API with an Accept header of application/octet-stream

This method requires the Attachments:Get permission to be associated with your role.

Permissions

The permission for this api is stored in [gb_api_permissions]permission as 'Attachments:Get'.

Only roles with a stored link to this permission in [gb_role_api_permissions] can run this api.

HTTP Method

Use the HTTP Method 'GET' for consuming this web service.

URL Examples

https://api.demo.catch-e.com/gb/attachments/{attachment_id} https://api.{{environment}}.catch-e.com/gb/attachments/{attachment_id} https://api.test.catch-e.com/gb/attachments/{attachment_id} 

Path Parameters

Key

Format

Notes

Mandatory

attachment_id

string

The Attachment Id. A positive whole number, up to 10 digits, with no leading zeros.

Yes

Response Details

Success

200 - OK

With the default Accept header, the attachment details are returned as JSON. With an Accept header of application/octet-stream, the file contents are returned.

Field

Format

Notes

attachment_id

string

Attachment Id.

table_name

string

Target table the attachment is associated with. Values: bk_booking_events, fm_approvals, fm_client_events, fm_contract_events, fm_contract_payouts, fm_driver_events, fm_maintenance, fm_supplier_events, gb_report_queue, qt_quote_events.

record_id

string

The unique id of the record in the target table the attachment is associated with.

filename

string

extension

string

md5

string

file_size

integer (int32)

File size in bytes.

notes

string

Notes.

user_id

string

created

string (date-time)

duplicate_check

boolean

status_flag

string

Status flag. Values: active.

{ "attachment_id": "1234", "table_name": "fm_approvals", "record_id": "5678", "filename": "invoice", "extension": "pdf", "md5": "[MD5-HASH]", "file_size": 204800, "notes": "Supplier invoice", "user_id": "1234", "created": "2026-01-15T09:30:00Z", "duplicate_check": false, "status_flag": "active", "_links": { "self": { "href": "https://api.catch-e.loc/gb/attachments/1234" } } } 

Error Response Details

Validation Message

Comments

401 - Unauthorized

1. You have not authenticated before running this API or 2. The token_timeout of the current session has passed. You need to authenticate again.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Unauthorized" } 

Validation Message

Comments

403 - Forbidden

You do not have permissions for this request. - Go to System Roles and enter 'web_services' - Navigate to the Roles / APIs tab to make sure the permission you need to run this API is checked.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Forbidden", "status": 403, "detail": "Forbidden" } 

Validation Message

Comments

404 - Not Found

The attachment does not exist.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Not Found", "status": 404, "detail": "Not Found" } 

Validation Message

Comments

406 - Not Acceptable

The Accept header of the request does not match a response format this API supports.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Not Acceptable", "status": 406, "detail": "Not Acceptable" } 

Validation Message

Comments

500 - Internal Error

An unexpected error occurred on the server.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "string", "status": 599, "detail": "string" }