Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

jmertic/KSU_Capstone_Spring_2011_PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP API for the SugarCRM Web Services API

Introduction:
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:
https://github.com/jmertic/KSU_Capstone_Spring_2011_PHP/zipball/master

- 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 

<?php
    // 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('');
    print_r($result);
    
    // Get the contact object with the given last name
    $result = $sugar->findContactByLastName('');
    print_r($result);
    
    // Get the account object with the given last name
    $result = $sugar->findAccountByName('');
    print_r($result);
    
    // Logout after you're done
    $sugar->logout();
?>

For more examples, go to this link: https://github.com/jmertic/KSU_Capstone_Spring_2011_PHP/tree/master/examples

To change the connection info at run-time, see below:
<?php
    // 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
    $curlR->setHost('');
    $curlR->setApiVersion(2);

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

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

About

Kent State Capstone class repo for the PHP API team

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages