System Records API: Gb Attachments deleteAttachment
Gb_* API endpoints for system record operations
Gb Attachments deleteAttachment
Warning: This web service has been deprecated and is no longer supported by Catch-e.
You must use APIs → Attachments to develop attachment API functions.
This web-service allows you to delete an attachment via a web service rather than using the regular web-based attachment upload function.
The system will set the of the attachment to 'deleted'. The record is left linked to the parent record, E.g. Event.
Input Fields
Input URL Examples
https://yourname.catch-e.net.au/services/gb/attachments/deleteAttachment?login=######&password=######&attachment_id=100256Output Fields
Error Codes
Gb Attachments loadAttachment
Warning: This web service has been deprecated and is no longer supported by Catch-e.
You must use APIs → Attachments to develop attachment API functions.
This web-service allows you to load an attachment via a web service rather than using the regular web-based attachment upload function.
This could be used to access attachments from another system.
Input Fields
Input URL Examples
https://yourname.catch-e.net.au/services/gb/attachments/loadAttachment?login=######&password=######&attachment_id=100256Output Fields
The response contains a link that will need to be entity de-coded. The link will timeout after 20 seconds.
Output Example
Error Codes
Gb Attachments saveAttachment
Warning: This web service has been deprecated and is no longer supported by Catch-e.
You must use APIs → Attachments to develop attachment API functions.
This web-service allows you to save an attachment via a web service rather than using the regular web-based attachment upload function.
Please note, the files you want to save as attachments must be placed in your DMZ folder in the "attachments" directory before running the saveAttachment service.
When this service has been run, the system checked the file has been loaded and then removes the original file from the DMZ folder.
If you are unsure of your DMZ access details, please contact Catch-e Support for further assistance.
Input Fields
Input URL Examples
https://yourname.catch-e.net.au/services/gb/attachments/saveAttachment?login=######&password=######&target_table=fm_contract_events&target_key=contract_event_id&target_record=116714&filename=testfile1.docOutput Fields
Output Example
true 100040 testfile txt testfile.txt 100540 2a75008348358778dd637bf3a533478a local 10000 [NULL] active
Error Codes
Error Output
CATCHEERRORATTACHMENTDOESNOTEXIST
Gb Drivers signon
Synopsis
Issues a single signon session id that can by-pass the login screen only once.
Input Fields
Input URL Examples
https://yourname.catch-e.net.au/services/fm/drivers/signon?driver_id=100001&surname=Quinnhttps://yourname.catch-e.net.au/core/services/rest/index.phpo?module=fm&script=drivers&action=signon&driver_id=100001&surname=Quinn&login=web_services&password=wouldntyouliketoknowOutput Fields
Output Example
signon=3f4afbd671aea676dce7a8d7a6ad1bed
Example Usage
window.location.href=https://yourname.catch-e.net.au/core/signon.phpo?signon=3f4afbd671aea676dce7a8d7a6ad1bedThis will default to the latest contract linked to driver_id used above. If you want system to default to a specific contract, you can pass in the required reg no as a parameter
window.location.href=https://yourname.catch-e.net.au/core/signon.phpo?signon=3f4afbd671aea676dce7a8d7a6ad1bed&default_reg_no=ABC123Error Codes
- 1 — The input field driverid is missing CATCHEERRORNODRIVERID_FIELD
- 2 — The input field surname is missing CATCHEERRORNOSURNAME_FIELD
- 3 — The input field driverid is empty CATCHEERRORNODRIVERID_VALUE
- 4 — There is no fmdrivers record with the given driverid value CATCHEERRORNODRIVER
- 5 — The input field surname value, does not match the surname value from fmdrivers for the given driverid CATCHEERRORDRIVERSURNAME
- 6 — No applicable contracts exist for the given driverid. Applicable contracts have a drivercontractaccessflag set to 'yes', in their Contract Type, and cannot be an Order. CATCHEERRORNOCONTRACT
- 7 — No login credentials found (i.e. not entry in gbusers) for the given driverid. An attempt will be made to create login credentials using details from fmdrivers. CATCHEERRORNODRIVERLOGIN
- 8 — The statusflag in gbusers is set to 'locked'. CATCHEERRORDRIVERLOGIN_LOCKED
- 9 — The statusflag in gbusers is set to 'suspended'. CATCHEERRORDRIVERLOGIN_SUSPENDED
- 10 — Rest call requests exceeded the limit set in . CATCHEERRORTOOMANY_REQUESTS
Error Output
CATCHEERRORDRIVERLOGIN_LOCKED
Gb Queries executeQueries
This job type allows you to run a report in the form of an SQL query, and send the output as an email attachment. It is useful for sending regular reports both internally and externally. Using the Attachment Required checkbox, exception reports can be generated where an email is sent only if the report finds anything.
Visit the User Defined Queries page for instructions on writing queries for the scheduler.
Email attachments will be converted to URLs if they exceed your set size limit.
A few jobs have been set-up to email Catch-e Support directly. These Scheduler Exception Queries are to monitor possible data issues for you.
Field Descriptions
| Attachment Format | Drop List | Choose the required format for the attachment file from 'Office(xlsx))', 'Office(xls)', 'Text (csv)', 'Text (txt) or 'XML'. 'Office(xlsx))' is the default value and saves with an xlsx suffix. Further parameter variables are hidden if this format is chosen. 'Office(xls)'Format) enables you to customiseFormat) the presentation of the generated files. Further parameter variables are hidden if this format is chosen. 'Text (csv)' generates a text delimited file and uses the CSV, Comma Separated Variable, format. 'Text (txt)' generates a text delimited file and uses the Text (Tab Delimited) format. 'XML' generates an XML based file.
| Column Headings? | Check Box | Check to have the column headings included in the file as the first row. This only applies to the 'Text' Attachment Format. | |
| Separated By | Drop List | Set the character(s) used to separate columns / fields in the output. E.g. using the option '|' will create a pipe separated file. This only applies to the 'Text' Attachment Format. In the special case where {tab} is being used for the separator, all tabs in the data will be replaced with white spaces to conform to the IANA standard for TSV files. | |
| Text Delimited By | Drop List | Set the character used to delimit columns / fields in the output if they contain special characters. Special characters include double quotes, newlines, and this delimiter character itself. The 'none' option will add no delimiters and is useful when the query itself adds the delimiters e.g. creating a custom interface file to specification. This only applies to the 'Text' Attachment Format. | |
| Omit Final Line Break? | Check Box | Select so that the final line of output will not end in a line break. This is required by some third party software for import purposes. This is un-checked by default. This only applies to the 'Text' Attachment Format. | |
| Singleton Tags? | Check Box | if you tick this, tags with empty values will use the singleton style format e.g. as opposed to . This only applies to the 'XML' Attachment Format. | |
| Indent Size | | Input, this sets the indentation (whitespaces) used, this must be an integer between 0 and 9. The default is 2. This only applies to the 'XML' Attachment Format. | |
| Newlines? | Check Box | if you tick this, all lines will end in a newline character. This improves readability when viewing or printing the XML from non-specialized text editors. This only applies to the 'XML' Attachment Format. | |
| Run Times | | | |
| Report Queue | | Check this to send reports to the Report Queue. | |
| Queue | | | |
| Recycling | Check Box | Check to recycle the job when it completes successfully. If you are recycling a report and sending it to the Report Queue, the "Started" and "Completed" timestamp details on the Report Queue screen will be lost each the job is recycled. The reports will, however, still display in the correct run order. | |
Channel Logo's in reports
Where an executeQuery is written to include a Channel the resulting Office(xls) generated report can contain a channel specific logo, an example query can be seen below:
## Contracts active the beginning of this month#channel_id added to SELECT statementSELECT t1.contract_id,t1.asset_id,t1.contract_start,t1.contract_end,t1.suspend_date,t1.reg_no,t1.description,t2.client_code,t3.surname,t3.given_name, t4.posting_map_code, t2.channel_idFROM fm_contracts AS t1LEFT JOIN fm_clients AS t2 ON t1.client_id = t2.client_idLEFT JOIN fm_drivers AS t3 ON t1.driver_id = t3.driver_idLEFT JOIN gl_posting_maps AS t4 ON t1.posting_map_id = t4.posting_map_idWHERE (t1.suspend_date > DATE_FORMAT(ADDDATE(curdate, INTERVAL 0 MONTH), '%Y-%m-01')OR t1.suspend_date = '0000-00-00')AND t1.contract_start <= DATE_FORMAT(SUBDATE(curdate, INTERVAL 0 MONTH), '%Y-%m-01')AND t1.contract_start != '0000-00-00'AND t1.contract_end != '0000-00-00'AND t1. reg_no != 'ORDER'#channel_id added as a conditionAND t2.channel_id = 100000ORDER BY t1.contract_id;Funds Check values
You can use Funds Check values in queries. See the sample query below:
## library_type standard## library_path /lib/PDF## library_name funds_checkSELECT rm.description,pmr.type,pm.posting_map_code,c.contract_id,c.reg_no,c.contract_start,c.contract_end,c.suspend_date,c.terminated_date,'->funds_finance_budget' AS funds_finance_budget,'->funds_finance_actual' AS funds_finance_actual,'->funds_finance_variance' AS funds_finance_variance,'->funds_finance_available' AS funds_finance_available,'->funds_finance_posting_class_codes' AS funds_finance_posting_class_codes,'->funds_finance_report_budget_as_actual' AS funds_finance_report_budget_as_actual,'->funds_finance_available_to_claim' AS funds_finance_available_to_claim,'->funds_unmapped_budget' AS funds_unmapped_budget,'->funds_unmapped_actual' AS funds_unmapped_actual,'->funds_unmapped_variance' AS funds_unmapped_variance,'->funds_unmapped_available' AS funds_unmapped_available,'->funds_unmapped_posting_class_codes' AS funds_unmapped_posting_class_codes,'->funds_total_budget' AS funds_total_budget,'->funds_total_actual' AS funds_total_actual,'->funds_total_variance' AS funds_total_variance,'->funds_total_available' AS funds_total_available,'->funds_received' AS funds_received,'->funds_variance' AS funds_variance,'->funds_available_balance' AS funds_available_balance,'->funds_actual_balance' AS funds_actual_balancefrom fm_contracts AS cINNER JOIN gl_posting_maps AS pm ON pm.posting_map_id = c.posting_map_idLEFT JOIN gl_posting_map_reporting AS pmr ON pmr.posting_map_id = c.posting_map_id AND pmr.type = 'funds_check'LEFT JOIN gl_reporting_maps AS rm ON rm.reporting_map_id = pmr.reporting_map_idwhere contract_id = 102940group by c.contract_idORDER BY c.contract_id