Kent State Capstone class repo for the PHP API team
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


PHP API for the SugarCRM Web Services API

We are working in a group of 5 members in order to design, implement, and demonstrate a user friendly API for an open source web services API. The API that we will be working with is SugarCRM API. As part of the development of this project we will work under the guidance of a representative, John Mertic, of the SugarCRM company. The project development procedures will be similar to those used by that company.

- Download the files from:

- Extract to folder in your root directory

- To change the default configuration, edit the Config.class.php file in the root of this project.

- Follow code examples below 

    // Include the wrapper class
    require_once 'SugarApi.class.php';
    // Instantiate the wrapper class
    $sugar = new SugarApi();
    // Log in using the default configuration data
    $session_id = $sugar->login();
    // Get the user object of the user with the specified username
    $result = $sugar->findUserByUserName('');
    // Get the contact object with the given last name
    $result = $sugar->findContactByLastName('');
    // Get the account object with the given last name
    $result = $sugar->findAccountByName('');
    // Logout after you're done

For more examples, go to this link:

To change the connection info at run-time, see below:
    // Include the wrapper class and SugarCurlRequest class
    require_once 'SugarApi.class.php';
    require_once 'curl/SugarCurlRequest.class.php';

    // Instantiate the wrapper class and curl object
    $sugar = new SugarApi();
    $curlR = new Curl_SugarCurlRequest();

    // Set the host and Api version

    // Set the curl object in the wrapper class
    $sugar->_curl = $curlR;

    // Log in with username and password
    $user_id = $sugar->login('<user_name>', '<password>');