PHPackages                             teamgate/php-api-sdk - 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. teamgate/php-api-sdk

ActiveLibrary[API Development](/categories/api)

teamgate/php-api-sdk
====================

Teamgate API SDK for PHP

v1.0(6y ago)11.5k↓100%3MITPHPPHP &gt;=5.5

Since Dec 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/teamgate/php-sdk)[ Packagist](https://packagist.org/packages/teamgate/php-api-sdk)[ Docs](https://github.com/teamgate/php-sdk)[ RSS](/packages/teamgate-php-api-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Teamgate API SDK for PHP
========================

[](#teamgate-api-sdk-for-php)

A cloud-based intelligent Sales CRM for small and mid-size teams. With its simple yet playful interface, Teamgate is a great sales stack for today’s business. See  for details. This is the official Teamgate API wrapper-client for PHP based apps, distributed by Teamgate Ltd. freely under the MIT licence.

Prerequisites
=============

[](#prerequisites)

You will need to make sure your server meets the following requirements:

- PHP &gt;= 5.5
- The PHP cURL extension

Getting Started
===============

[](#getting-started)

You can install via composer or by downloading the source. [Teamgate API](http://docs.teamgate.com/reference/) client utilizes Composer to manage its dependencies. So, before using Teamgate API client, make sure you have Composer installed on your machine.

Install Composer In Your Project
--------------------------------

[](#install-composer-in-your-project)

Run this in your command line:

```
curl -sS https://getcomposer.org/installer | php
```

Installation
------------

[](#installation)

To install run:

```
composer require teamgate/php-api-sdk:dev-master
```

Autoloading
-----------

[](#autoloading)

For libraries that specify autoload information, [Composer](https://getcomposer.org/download/) generates a `vendor/autoload.php` file. You can simply include this file and you will get autoloading for free.

```
require __DIR__ . '/vendor/autoload.php';
```

Basic Usage
===========

[](#basic-usage)

Here's a quick example that will list some deals from your Teamgate account:

```
require __DIR__ . '/vendor/autoload.php';

$api = new \Teamgate\API([
    'apiKey' => '_YOUR_ACCOUNT_API_KEY_', // located at account settings -> additional features -> external apps
    'authToken' => '_YOUR_PERSONAL_AUTH_TOKEN_' // located at user settings -> preferences
]);

$result = $api->deals->get([
        'offset' => 0,
        'limit' => 10
    ]
);
var_dump($result);
```

[Lead management](https://www.teamgate.com/solutions/lead-management/) is an important part of any [sales process](https://www.teamgate.com/solutions/sales-pipeline-management/). Create a new lead automatically whenever a visitor fills out a form on your site:

```
require __DIR__ . '/vendor/autoload.php';

$api = new \Teamgate\API([
    'apiKey' => '_YOUR_ACCOUNT_API_KEY_', // located at account settings -> additional features -> external apps
    'authToken' => '_YOUR_PERSONAL_AUTH_TOKEN_' // located at user settings -> preferences
]);

$result = $api->leads->create(
  [
    'title' => 'The Company Name'
  ]
);
var_dump($result);
```

Error Handling
--------------

[](#error-handling)

When you instantiate a client or make any request via service objects, exceptions can be raised for multiple of reasons e.g. a server error, an authentication error, an invalid params and etc.

Below shows how to properly handle exceptions:

```
require __DIR__ . '/vendor/autoload.php';

try
{
  $api = new \Teamgate\API([
      'apiKey' => '_YOUR_ACCOUNT_API_KEY_', // located at account settings -> additional features -> external apps
      'authToken' => '_YOUR_PERSONAL_AUTH_TOKEN_' // located at user settings -> preferences
  ]);
  $result = $api->leads->create(
    [
      'title' => 'The Company Name'
    ]
  ));
  var_dump($result);
}
catch (Teamgate\Exception\ValidationException $e)
{
  /* Invalid client configuration */
}
catch (Teamgate\Exception\TransportException $e)
{
  var_dump($e->getCode()); // HTTP Status Code
  var_dump($e->output); // Teamgate API Output
}
catch (Teamgate\Exception\ResponseException $e)
{
  /* Invalid query parameters or etc. */
}
catch (Exception $e)
{
  /* Other kind of exception */
}
```

Advanced Usage
==============

[](#advanced-usage)

For example retrieve all companies from your Teamgate account and change their logos by website domain through [Clearbit API](https://clearbit.com/docs#logo-api):

```
require __DIR__ . '/vendor/autoload.php';

$api = new \Teamgate\API([
    'apiKey' => '_YOUR_ACCOUNT_API_KEY_', // located at account settings -> additional features -> external apps
    'authToken' => '_YOUR_PERSONAL_AUTH_TOKEN_' // located at user settings -> preferences
]);

$result = $api->companies->get([
        'offset' => 0,
        'limit' => 10
    ]
);

foreach($result as $company) {
    if (!empty($company->data['urls']) && !empty($company->data['urls'][0] && !empty($company->data['urls'][0]['value']))
    {
        list($domain) = parse_url($company->data['urls'][0]['value'], PHP_URL_HOST);
        $logo = file_get_contents('https://logo.clearbit.com/' . $domain);
        if ($logo) {
            $company->changeLogo(
                [
                    'size' => strlen($logo),
                    'content' => base64_encode($logo)
                ]
            );
        }
    }
}

var_dump($result);
```

Documentation
=============

[](#documentation)

The documentation for the Teamgate API is located at

Getting Help
============

[](#getting-help)

If you need help installing or using the library, please contact Teamgate Support at `support@teamgate.com`. If you've instead found a bug in the library or [would like new features](https://www.teamgate.com/integration-request-forms/) added, go ahead and open issues or pull requests against this repo!

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2501d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bcf66cc342263fa482c85d51dc7ea44567580028328dd938fef350f1794f2fa2?d=identicon)[Outsidaz](/maintainers/Outsidaz)

---

Top Contributors

[![Outsidaz](https://avatars.githubusercontent.com/u/9278929?v=4)](https://github.com/Outsidaz "Outsidaz (14 commits)")

---

Tags

crmphp-sdkteamgateteamgate-api

### Embed Badge

![Health badge](/badges/teamgate-php-api-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/teamgate-php-api-sdk/health.svg)](https://phpackages.com/packages/teamgate-php-api-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M474](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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