Skip to main content
Attachments

Save an attachment

This service allows you to save an attachment via the API rather than using the regular web-based attachment upload function.

POST
/gb/attachments

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

Authorizationstringheaderrequired

For accessing the API a valid token must be passed in all the queries in the 'Authorization' header.

A valid token is generated by the API and returned by the /authenticate method by supplying a valid username and password.

The following syntax must be used in the 'Authorization' header :

Bearer aaaaaa/bbbbbb.ccccccc.dddddd
Audit-User-Idstringheader

(Optional) User Id to use for audit purposes. This header requires the Audit:UserIdOverride permission to be associated with your role.

Maximum string length: 5
Pattern: ^[1-9]{1}[0-9]*$

Body

multipart/form-data
attachment_filestringrequired

Attachment file

notesstring

(Optional) Notes to be stored with the attachment

Maximum string length: 65535
Pattern: ^[\w\W\d\s]*$
record_idstringrequired

The unique (primary) id of the record in the target table the attachment is to be associated with

Maximum string length: 20
Pattern: ^[1-9]{1}[0-9]*$
target_tableenum<string>required

Target table

Available options: bk_booking_events, fm_approvals, fm_client_events, fm_contract_events, fm_driver_events, fm_maintenance, fm_supplier_events, qt_quote_events

Response

application/vnd.catch-e-api.v1+json

Success

attachment_idstring

Attachment Id

Maximum string length: 10
Pattern: ^[1-9]{1}[0-9]*$
Example: 100000
createdstring
duplicate_checkboolean
extensionstring
Maximum string length: 10
Pattern: ^[a-zA-Z0-9]+$
Example: pdf
file_sizeinteger

File size in bytes

Required range: 0 <= x <= 1048576000
Example: 1293942
filenamestring
Maximum string length: 100
Example: hello-world
md5string
Required string length: 32 - 32
Example: fc5e038d38a57032085441e7fe7010b0
notesstring

Notes

Maximum string length: 65535
Pattern: ^[\w\W\d\s]*$
Example: Hello world
record_idstring

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

Maximum string length: 20
Pattern: ^[1-9]{1}[0-9]*$
Example: 123456
status_flagenum<string>default:active

Status flag

Available options: active
Example: active
table_nameenum<string>

Target table the attachment is associated with

Available options: 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
user_idstring
Maximum string length: 10
Pattern: ^[1-9]{1}[0-9]*$
Example: 10000