I created a plugin which provides custom validation for civicrm forms. Part of the jQuery validation on the plugin makes an AJAX call to the plugin. The plugin calls its onAjax[Name] method. In the onAjax[Name] method, I want to use civicrm_api3( ... ). However, the system returns a fatal error
Call to undefined function civicrm_api3()
How do I use civicrm_api3 in the above context? Do I need to import some class files? The same code works if the validation occurs when the form is submitted with the submit button instead of AJAX.