ste80pa/suitecrm-client

SuiteCRM Soap and Rest Client

dev-master 2017-10-14 23:23 UTC

This package is not auto-updated.

Last update: 2024-04-14 02:13:26 UTC


README

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