Accessing API Commands in Your Custom Module
JEM allows you to access certain API commands for custom modules. You may need this for forwarding member data to your custom modules/functions.
To load API commands, you must first do the following:
- Open up /system/application/config/api.php
- Locate the module type you are using, and add the API classes you need to load for each type. Separate them with commas. For example:
$config['jem_api_login_models'] = 'members,products,commissions';
$config['jem_api_login_helpers'] = 'country,string'; - the models are essentially the classes listed in /system/application/models, while helpers are the function files listed in /system/application/helpers. For more information on models and helpers, consult the CodeIgniter documentation
- Once you have saved the api.php file, you can now access the api commands in your module. For example:
$this->members_api->_get_member_details($data['member_id']); - Listing of API commands can be found here
