Code Monkey home page Code Monkey logo

nimble-php's Introduction

nimble-php

PHP bindings to the Nimble CRM API

Installation

This library requires PHP 7.1 and later

The recommended way to install nimble php is through Composer:

This library is intended to speed up development time but is not a shortcut to reading the Nimble API documentation. Many endpoints require specific and required fields for successful operation. Always read the documentation before using an endpoint.

composer require mckltech/nimble-php

Clients - API Key

Initialize your client using your access token:

use Nimble\NimbleClient;

$client = new NimbleClient('API_ACCESS_KEY_XXXX');

Support, Issues & Bugs

This library is unofficial and is not endorsed or supported by Nimble.

For bugs and issues, open an issue in this repo and feel free to submit a PR. Any issues that do not contain full logs or explainations will be closed. We need you to help us help you!

API Versions

This library is intended to work with Version 1.3 of the Nimble Public API

Users

/** List Contacts */
$client->contacts->list();

/** Find Contact By Email */
$client->contacts->findBy('[email protected]');

/** Create A Contact */
$options = ['last name' => [['value' => 'Smith']], 'first name' => [['value' => 'Nimble']], 'email' => [['value' => '[email protected]']]];

$payload = ['fields' => $options];

$client->contacts->create($payload);

Supported Endpoints

All endpoints follow a similar mechanism to the examples show above. Again, please ensure you read the Nimble API documentation prior to use as there are numerous required fields for most POST/PUT operations.

  • Contacts
  • Users
  • Company
  • Tasks

Exceptions

Exceptions are handled by HTTPlug. Every exception thrown implements Http\Client\Exception. See the http client exceptions and the client and server errors. If you want to catch errors you can wrap your API call into a try/catch block:

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

Credit

The layout and methodology used in this library is courtesy of https://github.com/intercom/intercom-php

nimble-php's People

Watchers

 avatar  avatar

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.