PHPackages                             processfast/yii2-suitecrm-rest-api-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. processfast/yii2-suitecrm-rest-api-client

ActiveYii2-extension[API Development](/categories/api)

processfast/yii2-suitecrm-rest-api-client
=========================================

SuiteCRM / SugarCRM 6.x REST API Wrapper Class

18.9kPHP

Since Mar 6Pushed 4y ago4 watchersCompare

[ Source](https://github.com/ProcessFast/yii2-suitecrm-rest-api-client)[ Packagist](https://packagist.org/packages/processfast/yii2-suitecrm-rest-api-client)[ RSS](/packages/processfast-yii2-suitecrm-rest-api-client/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

SuiteCRM / SugarCRM REST API Client for Yii2 - Connect your Yii2 app to a SuiteCRM / SugarCRM instance
======================================================================================================

[](#suitecrm--sugarcrm-rest-api-client-for-yii2---connect-your-yii2-app-to-a-suitecrm--sugarcrm-instance)

This extension provides the AWS SDK 3 integration for the Yii2 framework

[![Latest Stable Version](https://camo.githubusercontent.com/5f18c4b289ba9ccf7282f751aef7aa34045ba3972ea55d7482a90e435524a194/68747470733a2f2f706f7365722e707567782e6f72672f7061636b616765732f70726f63657373666173742f796969322d737569746563726d2d726573742d6170692d636c69656e742f762f737461626c65)](https://packagist.org/packages/processfast/yii2-suitecrm-rest-api-client) [![Total Downloads](https://camo.githubusercontent.com/f0fa0a5d95ba645f307c6d79008c6d901947c49b128a1969a4768d97835d2e35/68747470733a2f2f706f7365722e707567782e6f72672f70726f63657373666173742f796969322d737569746563726d2d726573742d6170692d636c69656e742f646f776e6c6f616473)](https://packagist.org/packages/processfast/yii2-suitecrm-rest-api-client) [![Latest Unstable Version](https://camo.githubusercontent.com/a934259c774e73c8910beacb7fbf5225c487bcbe0b5c372b878fa518c4700afe/68747470733a2f2f706f7365722e707567782e6f72672f70726f63657373666173742f796969322d737569746563726d2d726573742d6170692d636c69656e742f762f756e737461626c65)](https://packagist.org/packages/processfast/yii2-suitecrm-rest-api-client) [![License](https://camo.githubusercontent.com/4325353ce25fb1a0a89f4486a0d5495b96e7f76705e053e98c26eb38e83a3c7a/68747470733a2f2f706f7365722e707567782e6f72672f70726f63657373666173742f796969322d737569746563726d2d726573742d6170692d636c69656e742f6c6963656e7365)](https://packagist.org/packages/processfast/yii2-suitecrm-rest-api-client)

Contents
--------

[](#contents)

1. About
2. Installation
3. Yii2 Configuration
4. Usage Example
5. Notes
6. get\_note\_attachment() Example
7. set\_note\_attachment() Example

1.About
-------

[](#1about)

- PHP wrapper class for interacting with a SugarCRM REST API
- Creating, reading, and updating capability
- More info on SuiteCRM:
- More info on SugarCRM:
- API docs:
- Designed to work with SuiteCRM / SugarCRM v.6

2.Installation
--------------

[](#2installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
    php composer.phar require --prefer-dist processfast/yii2-suitecrm-rest-api-client "*"

```

or add

```
    "processfast/yii2-suitecrm-rest-api-client": "*"

```

to the require section of your `composer.json` file.

3.Yii2 Configuration
--------------------

[](#3yii2-configuration)

To use this extension, simply add the following code in your application configuration:

```
return [
    //....
    'components' => [
        'suitecrm' => [
            'class' => 'processfast\suitecrm\SuiteCrmRestApi',
            'rest_url' => 'https://mysuitecrm.com/service/v2/rest.php',
            'username' => 'your-crm-username',
            'password' => 'your-crm-password'
        ],
    ],
];
```

4.Usage Example
---------------

[](#4usage-example)

Example Snippet:

```
    $suiteCrm = Yii::$app->suitecrm;

    $suiteCrm->connect();

    $error = $suiteCrm->get_error();

    if($error !== FALSE) {
        return $error['name'];
    }

    $results = $suiteCrm->get_with_related("Accounts",
                                            array("Accounts" => array('id','name'),
                                            "Cases" => array('id','status')));
    $suiteCrm->print_results($results);
```

5.Notes
-------

[](#5notes)

- The `is_valid_id()` function may need to modify for different versions of SugarCRM.
- Different versions of SugarCRM have different ID formats.

6.get\_note\_attachment() Example
---------------------------------

[](#6get_note_attachment-example)

> This example outputs the contents of a note's attachment, given the note ID. Assumes $note\_id contains the ID of the note you wish to modify.

```
$suiteCrm = Yii::$app->suitecrm;
$suiteCrm->connect();

$result = $suiteCrm->get_note_attachment($note_id);
$filename = $result['note_attachment']['filename'];
$file = $result['note_attachment']['file'];

$file = base64_decode($file);
header("Cache-Control: no-cache private");
header("Content-Description: File Transfer");
header('Content-disposition: attachment; filename='.$filename);
header("Content-Type: application/vnd.ms-excel");
header("Content-Transfer-Encoding: binary");
header('Content-Length: '. strlen($file));
echo $file;
exit;

```

6.set\_note\_attachment() Example
---------------------------------

[](#6set_note_attachment-example)

> This example illustrates how to set a note's attachment from an html form. Assumes $note\_id contains the ID of the note you wish to modify.

### HTML Code

[](#html-code)

```

```

### PHP Code (example.php)

[](#php-code-examplephp)

```
$suiteCrm = Yii::$app->suitecrm;
$suiteCrm->connect();

if ($_FILES["note_file"]["error"] > 0) {
	// Error: $_FILES["file"]["error"]
} else if(isset($_FILES['note_file']['tmp_name']) && $_FILES['note_file']['tmp_name']!="") {
	$handle = fopen($_FILES['note_file']['tmp_name'], "rb");
	$filename = $_FILES['note_file']['name'];
	$contents = fread($handle, filesize($_FILES['note_file']['tmp_name']));
	$binary = base64_encode($contents);
	$file_results = $sugar->set_note_attachment($note_id,$binary,$filename);
}

```

7.get\_available\_modules() Example
-----------------------------------

[](#7get_available_modules-example)

> This example illustrates how to get the available modules in SuiteCRM/SugarCRM. All of them. This is a handy function to use when building future proof SuiteCRM/SugarCRM plugins.

### PHP Code (example.php)

[](#php-code-examplephp-1)

```
$suiteCrm = Yii::$app->suitecrm;
$modules = $suiteCrm->get_available_modules();

```

> BAM! Now loop through the array that was returned and stored in $modules. You could use this to display a dropdown in the admin panel that displays all modules a user would want to connect your sugarcrm plugin to.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1058532?v=4)[Brad Stancel](/maintainers/stancel)[@stancel](https://github.com/stancel)

---

Top Contributors

[![stancel](https://avatars.githubusercontent.com/u/1058532?v=4)](https://github.com/stancel "stancel (10 commits)")[![jaiminmoslake7020](https://avatars.githubusercontent.com/u/4865636?v=4)](https://github.com/jaiminmoslake7020 "jaiminmoslake7020 (1 commits)")

---

Tags

opsinsightssuitecrmyii2-configuration

### Embed Badge

![Health badge](/badges/processfast-yii2-suitecrm-rest-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/processfast-yii2-suitecrm-rest-api-client/health.svg)](https://phpackages.com/packages/processfast-yii2-suitecrm-rest-api-client)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)[pixelant/pxa-social-feed

Add Facebook, Instagram, and Twitter feeds to your site.

2349.3k](/packages/pixelant-pxa-social-feed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
