• Developer
Search »

Debugging Mode

The API uses the $g_api_debug variable used to toggle debugging mode on and off for all the API functions. By default, debugging is disabled. On API versions earlier than 2.0.0, this setting was enabled by default.

When you're in debugging mode, any time an error occurs it halts your code and displays the error in the webpage. The errors consistent of the error type ("user" or "system") and the unique error code. The page contains a link to the online help documentation which describes the nature of the error - and maybe a tip or two to solve it. Error types indicate the severity of the error. "user" errors indicate that the function has been fed an incorrect value or two; "system" errors mean that some worse has happened: either a file is missing or there's a bug on our end.

You can turn on/off debugging in two ways. First, by adding the $g_api_debug variable to your page before you instantiate the API class to use its methods:

Or, you can just add the following line to your /global/config.php file:

This will set the debug value for any methods calling the API unless that location has specified their own value, which will override this default.