/suitecrm-client

A simple PHP Soap and Rest Client for SuiteCRM

Primary LanguagePHPGNU Lesser General Public License v3.0LGPL-3.0

Minimum PHP Version Build Status Coverage Status

Synopsis

Simple library to communicate with SuiteCRM via Soap or Restful endpoints

Code Example

Using Soap endopoint

<?php

include('vendor/autoload.php');

use ste80pa\SuiteCRMClient\Types\Requests\GetEntryListRequest;
use ste80pa\SuiteCRMClient\Types\Requests\LoginRequest;
use ste80pa\SuiteCRMClient\SoapClient;
use ste80pa\SuiteCRMClient\Session;

$url = 'your sugar crm host';
$username = 'your username';
$password = 'your password';

$session = new Session($url, $username, $password);

$client = new SoapClient($session);

$client->login();

$request = new GetEntryListRequest();

$request->module_name   = 'Accounts';
$request->select_fields = array('id', 'name');
$request->max_results   = 100;
$request->favorites     = false;
$request->deleted       = 1;
 
$accounts = $client->getEntryList($request); 

print_r($accounts);

Using Rest endopoint

<?php

include('vendor/autoload.php');

use ste80pa\SuiteCRMClient\Types\Requests\GetEntryListRequest;
use ste80pa\SuiteCRMClient\Types\Requests\LoginRequest;
use ste80pa\SuiteCRMClient\RestClient;
use ste80pa\SuiteCRMClient\Session;

$url = 'your sugar crm host';
$username = 'your username';
$password = 'your password';

$session = new Session($url, $username, $password);

$client = new RestClient($session);

$client->login();

$request = new GetEntryListRequest();

$request->module_name   = 'Accounts';
$request->select_fields = array('id', 'name');
$request->max_results   = 100;
$request->favorites     = false;
$request->deleted       = 1;
 
$accounts = $client->getEntryList($request); 

print_r($accounts);

Motivation

Installation

composer require ste80pa/suitecrm-client:dev-master

API Reference

Tests

To run all tests

phpunit

Contributors

License