SuiteAPI with custom modules

Ive been able to run a PHP script outside of SuiteCRM that logs in and can return back JSON data for Accounts, Project, Leads, Contacts and a few others.
Is there a process where I can add new modules to this? I suppose i can modify the SugarWebServiceImp.php files but I suspect it might there might be an easier way. I have a few custom modules i’d like to be able to pull into another application.

Thanks for any insight.
Steve

Hi,

You don’t need to change anything. All functions (get_entry, get_entry_list, … ) work with custom modules as long as they support ACLs.

Benoit

Thanks Benoit…
I am a bit of a newbie here. What is an ACL?

Here is the PHP code from the file that calls the SuiteCRM Rest api. “institute” is a custom module. IF i replace that with “Project”, “Contact”, “Leads” it works fine. But not with any custom made modules. So i assume there is some hard code that set up the allowed modules inside the API programs.

IF thats the case is there a work around or better yet an “selected modules for use by API” section in the Admin side.
thanks
steve


$fields_array = array('name');
$parameters = array(

    'session' => $session,                                 //Session ID
    'module_name' => 'Institute',                             //Module name
    'query' => " institute.name IS NOT NULL ",   //Where condition without "where" keyword
    'order_by' => " institute.id ",                 //$order_by
    'offset'  => 0,                                               //offset
    'select_fields' => $fields_array,                      //select_fields
    'link_name_to_fields_array' => array(array()),//optional
    'max_results' => 5,                                        //max results                  
    'deleted' => 'false',                                        //deleted
);



I confirm all custom modules should work if they have been built with Module Builder.
Are you sure the name is Institute (it might be XX_Institute where XX is the key you entered in module builder).
Same issur with table name. It moght not be institute.

Look at the modules folder. The module name you need to use is the name of the folder where your custom module is.

1 Like

thanks… i had to use the key as well.
works well now

Thanks man :slight_smile: It works with the key, Thanks again