PHPackages                             kzap/ontraport-php-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. kzap/ontraport-php-sdk

ActiveLibrary[API Development](/categories/api)

kzap/ontraport-php-sdk
======================

Ontraport PHP SDK

0.1.9(10y ago)2991MITPHPPHP &gt;=5.5.9

Since Sep 18Pushed 9y ago2 watchersCompare

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

READMEChangelogDependencies (1)Versions (11)Used By (0)

Developed for [Examine.com](https://examine.com)

ontraport-php-sdk
=================

[](#ontraport-php-sdk)

SDK for the New ONTRAPORT API

Uses Guzzle 5.3

Based on original documentation located here:

[**composer**](https://getcomposer.org/) is the recommended way to install the SDK.

It is available at [https://packagist.org](https://packagist.org/packages/kzap/ontraport-php-sdk). To use it in your project, you need to include it as a dependency in your project composer.json file.

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

[](#installation)

1. Download [Composer](https://getcomposer.org/download/) if not already installed
2. Go to your project directory. If you do not have one, just create a directory and `cd` in.

    ```
    ```

mkdir project cd project ``` 3. Execute `composer require "kzap/ontraport-php-sdk:*" ` on command line. Replace composer with composer.phar if required. It should show something like this:

```
```sh

```

> composer require "kzap/ontraport-php-sdk:\*"

Loading composer repositories with package information Updating dependencies (including require-dev)

- Installing kzap/ontraport-php-sdk (0.1) Loading from cache

Writing lock file Generating autoload files ```

How to use
----------

[](#how-to-use)

1. Make sure you are auto-loading Composer in your bootstrap file or main php file:

    ```
    ```

require\_once **DIR** . '/vendor/autoload.php'; ``` 2. In your class or PHP file, include the namespace of the class:

```
```php

```

use Kzap\\Ontraport\\Api\\Sdk as OntraportSdk; ``` 3. In your constructor or wherever you want to instantiate / use the API, create a new instance of the class and use your **APP\_ID** and **API\_KEY** as the parameters:

```
```php

```

$this-&gt;ontraportSdk = new OntraportSdk("{APP\_ID}", "{API\_KEY}"); ``` 4. Call one of the methods in **Sdk.php** to access the API:

```
```php

```

$parameters = array( 'objectId' =&gt; $this-&gt;ontraportSdk-&gt;getObjectTypeByName('contact'), ); $jsonResponse = $this-&gt;ontraportSdk-&gt;getObject($parameters); var\_dump($jsonResponse); ```

Sample code
-----------

[](#sample-code)

```
