Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
yguzaiz edited this page May 5, 2011 · 40 revisions

Introduction

Welcome to Wiki for the SugarCRM API PHP wrapper class. 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.

Project Overview

The goal of this project is to provide a user-friendly front-end to the SugarCRM API. We intend to accomplish this goal using several different methods:

  1. First, we implemented each API function as a PHP class using a generic API function class, which is then extended to allow each API function different functionality.
  2. Next, we wrote a wrapper class to allow easy access to these classes.
  3. Finally, we wrote several shortcut methods to allow for quick access to commonly used functions, such as getting a user by their username.

Reports

What is PHP?

PHP is a general-purpose scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document. It also has evolved to include a command-line interface capability and can be used in standalone graphical applications. Learn more..

What is the Sugarcrm?

SugarCRM is the world's leading provider of open source customer relationship management (CRM) software. Over 7,000 customers and more than half a million users rely on SugarCRM to execute marketing programs, grow sales, retain customers and create custom business applications.

API Definitions

SugarCRM provides an application programming interface, Sugar Web Services API, to enable you to customize and extend your Sugar application. As of version 5.5.0, Sugar provides an API for enhanced performance and provides versioning to help extend your Sugar application in an upgrade-safe manner.

  1. Create a generic interface for the API using PHP classes
  2. Wrap each API method (which are implemented as PHP classes in the first step) into a PHP class
  3. Add methods to the wrapper class for easy access to common use cases
  4. Re-write the API-provided data objects into an easier-to-parse structure

PHP API for the SugarCRM Web Services API

Read me

SugarCRM Server

You can see the the API definition for initializing an object here: Login.class.php out put: "Login Successful! Session ID is p5kjdo5peh5o2flplvii9pe2p2"

Api Function Class

Api Function Class

Unit Testing

Testing is an essential aspect of developing in any programming language. If you don't test your source code then how can you verify it works as expected.Testing early is like catching the proverbial worm; as you write code, you can use Unit Tests to test isolated methods/classes or groups of functional classes immediately. By doing so you find and fix bugs quickly as they are created. A problem is that you find bugs so often, and fix them so quickly, that you barely notice the time it took. When you make changes later, and a test fails, you can fix the integration problem just as quickly - more saved time you barely notice. The benefits can be so well disguised you may miss them completely - and only see the test code it took you a few hours to write, not the bugs you solved in 10 seconds that would have taken minutes or hours six months down the line.

Useful Links