Get an Attachment Resource Pre-signed URL

Allows you to create a pre-signed URL for the given attachment.

To obtain the attachment binary contents:

  • Forward the user to the URL returned from the getAttachmentPresignedUrl method (recommended if applicable)

  • Capture the binary stream from the URL returned from the getAttachmentPresignedUrl method

  • Invoke this API preferencing the 'application/octet-stream' response

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

Permissions

To run this API, the nominated 'web-services' role needs to be given permission.

If you are not actively using the API, leave the permission off for better security.

Go to Roles / APIs and check on Attachments:Get.

HTTP Method

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

URL Examples

Input Fields (Body)

JSON

Field Format

Notes

Mandatory

attachment_id

Int

Attachment ID

Yes

url_timeout

Int

URL timeout in seconds

No

Input Fields (JSON)

{ "attachment_id": 100000, "url_timeout": 300 } 

Successful Response Example

{ "url": "https://catch-e-client-assets.s3.ap-southeast-2.amazonaws.com/client/example/100000?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20190201%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20190201T045824Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Signature=6dcb136a7e0d285419ec8f88602785df41dc0036df8657bbc6e20309d3f3d5ba" } 

Error Response Details

Validation Message

Comments

401 Unauthorized

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

404 - Not Found

Missing attachment or object not found

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

422 - noRecordFound

No object available in the system

500 - Internal Error

Internal server error


Save an Attachment

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

Permissions

To run this API, the nominated 'web-services' role needs to be given permission.

If you are not actively using the API, leave the permission off for better security.

Go to Roles / APIs and check on Attachments:Save.

HTTP Method

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

URL Examples

Headers

Key

Format

Notes

Mandatory

Audit-User-Id

string

Pass a user_id here to create audit records with this user's details. This can only be done if the authenticated API user has Roles / APIs checked for the permission Audit:UserIdOverride

No

Input Fields (Body)

JSON

Field Format

Notes

Mandatory

attachment_file

Choose file

Attach a file

Yes

target_table

Text

Nominate the table name for the attachment. Available tables: bk_booking_events, fm_approvals, fm_client_events, fm_contract_events, fm_driver_events, fm_maintenance, fm_supplier_events, qt_quote_events

Yes

record_id

Text

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

Yes

notes

Text

Add notes to be stored with the attachment

No

Successful Response Example

{ "attachment_id": "100348", "table_name": "fm_approvals", "record_id": 104256, "filename": "fm_approvals", "extension": "csv", "md5": "79db7ccbfc353b8ed0f816f27c70792d", "file_size": 24, "notes": null, "user_id": "11065", "created": "2021-07-20T05:05:03Z", "duplicate_check": true, "status_flag": "active", "_links": { "self": { "href": "https://api.catch-e.com/gb/attachments/100348" } } } 

Error Response Details

Validation Message

Comments

401 Unauthorized

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

404 - Not Found

Missing attachment or object not found

422 - Unsupported target table

Unsupported target table

422 - Unprocessable Entity

The same file has already been attached to the associated record

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

422 - File size exceeded

The uploaded file exceeds the maximum filesize

422 - noRecordFound

No object available in the system

500 - Internal Error

Internal server error


Delete an Attachment

Allows you to delete an attachment.

Permissions

To run this API, the nominated 'web-services' role needs to be given permission.

If you are not actively using the API, leave the permission off for better security.

Go to Roles / APIs and check on Attachments:Delete.

HTTP Method

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

URL Examples

Input Fields (Body)

JSON

Field Format

Notes

Mandatory

attachment_id

Int

Attachment ID

Yes

Input Fields (JSON)

{ "attachment_id": 100000 } 

Successful Response Example

204 No Content 

Error Response Details

Validation Message

Comments

204 No Content

The request was successful. No response is required

401 - Unauthorized

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

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

422 - noRecordFound

No object available in the system

500 - Unexpected error

JSON encoding error or malformed UTF-8 characters. If a query has encrypted fields which are not decrypted using aes_decrypt in JSON response, please decrypt the fields in query before adding the query in table


Template Attachments

Emails can be set-up to contain template attachments. This includes emails generated by scheduler mailQuery jobs. You can attach one or multiple attachments.

Examples of Suitable Applications

  • Attaching an FBT Statutory Declaration to Novated Driver Reports at FBT year end

  • Attaching an explanatory document to the Novated Driver login notification

  • Attaching a finance application to a Novated Vehicle Quote

  • Using HTML to customise the email message when sending a quote

Contact Catch-e support if you would like to have any attachments set up.

Technical Description

Template reports are setup in the table gb_templates. The table gb_template_attachments is linked to gb_templates via template_id.

This allows multiple static attachments to be included. The static document needs to be uploaded to the following folder:

/[client]/core/fleet/reports/attachments/

Table Fields

The table gb_template_attachments has the following fields:

Field

Description

template_attachment_id

Unique id

template_id

template_id from gb_templates

file

Full name of file, for example: /clientname/core/fleet/reports/attachments/FBT_Declaration.pdf

status_flag

Either 'active' or 'inactive'. If 'inactive' attachment is ignored

Each entry in this table represents one additional file attachment for the email. Multiple entries for a given template_id will result in multiple attachments.

Customising Quote Email Body

The email body when sending a quote email is linked to the Quote PDF document. The template may be named 'pdf_quote_nofb_lease'. Instructions for editing this template:

  1. Use a docx file

  2. Change document as required and save (Catch-e will keep a copy in a project task)

  3. Save the document again with the format 'Web Page, Filtered'

  4. Open the resulting file in notepad and cut and paste the text into the message field in gb_templates for the required template


Get Suppressed Destination

This API is used to check if a specified email address is a suppressed destination.

Suppressed emails will bounce. See reporting details of this on the Mail Failed page.

Permissions

To run this API, the nominated 'web-services' role needs to be given permission.

If you are not actively using the API, leave the permission off for better security.

Go to Roles / APIs and check on Mail:SuppressedDestinationGet.

Input Fields (Header)

Header should contain the 'accept' Key with the Value = 'application/problem+json' or 'application/vnd.catch-e-api.v1+json'.

Input Fields (Body)

JSON

Field Format

Notes

Mandatory

email_address

String

Email address

Yes

URL Examples

https://api.catch-e.com/docs/#/Mail/getSuppressedDestination

Response Details

Validation Message

Comments

200

Email Address is suppressed

401 - Unauthorized

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

403 - Forbidden

You do not have permissions for this request. Navigate to the Roles / APIs tab to make sure the permission you need to run this API is checked

404 - Email Address Not Found

Email address not found in suppression list

406 - Not Acceptable

Not Acceptable

422 - Unprocessable Entity

Unprocessable Entity

500 - Unexpected error

Internal server error


Delete Suppressed Destination

This API is used to remove an email address from the suppression list.

Suppressed emails will bounce. See reporting details of this on the Mail Failed page.

Permissions

To run this API, the nominated 'web-services' role needs to be given permission.

If you are not actively using the API, leave the permission off for better security.

Go to Roles / APIs and check on Mail:SuppressedDestinationDelete.

Input Fields (Header)

Header should contain the 'accept' Key with the Value = 'application/problem+json' or 'application/vnd.catch-e-api.v1+json'.

Input Fields (Body)

JSON

Field Format

Notes

Mandatory

email_address

String

Email address

Yes

URL Examples

https://api.catch-e.com/docs/#/Mail/deleteSuppressedDestination

Response Details

Validation Message

Comments

204 No Content

Email Address has been deleted from the suppression list

401 - Unauthorized

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

403 - Forbidden

You do not have permissions for this request. Navigate to the Roles / APIs tab to make sure the permission you need to run this API is checked

404 - Email Address Not Found

Email address not found

406 - Not Acceptable

Not Acceptable

500 - Unexpected error

Internal server error