Custom Code Hooks Vs. API
Custom Code Hooks (see Tools -> System -> Add-ons) allow you to write custom PHP code that can be triggered when events within NolaPro occur like adding customers or invoices if you want some additional special processing to happen. This is only applicable for users who host themselves.
You can use the list of Events under Tools -> System -> User Activity Monitor as a guide for what events you can create code hooks for. The code hook trigger title will be the Event name, but in all lower case and separated by periods. AR -> invoice -> update will become ar.invoice.update.
To make a code hook, start a PHP file and at the top register your code hook like the following:
register_custom('ar.invoice.update', 'custom_my_extra_invoice_processing');
You can then create a function called custom_my_extra_invoice_processing($params). The system will drop in parameters that you can use for your special processing like the invoice ID and invoice number in this example.
You can add global $conn; to your function to access the database. ($conn->execute($sql); to run a query)
Place the file in a directory called custom just below the root NolaPro directory.
The API serves a different purpose. The API allows you to get data out of and send data into NolaPro. You control when data is sent or pulled out of NolaPro when using the API. The API is not tied to NolaPro events. You can find some general info on the NolaPro API here.
API Log Viewer
Where: Tools -> System -> API Log Viewer
When an integration talks to NolaPro through the API, every call is logged. The API Log Viewer lets you see what was actually sent and received, which is the first place to look when an integration does not do what you expected.
1) Under Report Filters, enter the Begin Date and Begin Time and the End Date and End Time of the period to examine and click Next.
2) Each logged call shows its Date, Trans ID, Company ID, User ID (the API user that made the call), the Action requested and a summary of the Data.
3) Click View on a row to open the full detail of that transaction, including the data that was posted, in a new tab.