Code Monkey home page Code Monkey logo

close-php's Introduction

close-php

PHP bindings to the Close.com API

Installation

This library supports PHP 7.1 and later

The recommended way to install close-php is through Composer:

composer require mckltech/close-php php-http/guzzle6-adapter

Clients

Initialize your client using your access token:

use Close\CloseClient;

$client = new CloseClient('<insert_key_here>');

If you already have an API key you can find it here. If you want to create or learn more about API Keys then you can find more info here.

API Versions

This library is intended to work with V1 of the Close API

Exceptions

Exceptions are handled by HTTPlug. Every exception thrown implements Http\Client\Exception. See the http client exceptions and the client and server errors. The SDK may return an unsuccessful HTTP response, for example when a resource is not found (404). If you want to catch errors you can wrap your API call into a try/catch block:

try {
    $user = $client->contacts->getContact("570680a8a1bcbca8a90001b9");
} catch(Http\Client\Exception $e) {
    if ($e->getCode() == '404') {
        // Handle 404 error
        return;
    } else {
        throw $e;
    }
}

Credit

This library is not endorsed or maintained by Close.com

This library is based on the awesome work of the team at https://github.com/intercom/intercom-php

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.