Download the PHP package basecrm/basecrm-php without Composer

On this page you can find all versions of the php package basecrm/basecrm-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package basecrm-php

basecrm-php

BaseCRM Official API V2 library client for PHP

Installation

The recommended way to install the client is through Composer.

Next, run the Composer command to install the latest stable version :

After installing, you need to require Composer's autoloader:

Usage

Build a client

Using this api without authentication gives an error

Client Options

The following options are available while instantiating a client:

Architecture

The library follows few architectural principles you should understand before digging deeper.

  1. Interactions with resources are done via service objects.
  2. Service objects are exposed as properties on client instances.
  3. Service objects expose resource-oriented actions.
  4. Actions return associative arrays.

For example, to interact with deals API you will use \BaseCRM\DealsService, which you can get if you call:

To retrieve list of resources and use filtering you will call #all method:

To find a resource by it's unique identifier use #get method:

When you'd like to create a resource, or update it's attributes you want to use either #create or #update methods. For example if you want to create a new deal you will call:

To destroy a resource use #destroy method:

There other non-CRUD operations supported as well. Please contact corresponding service files for in-depth documentation.

Full example

Create a new organization and after that change it's attributes (website).

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 network error, an authentication error, an invalid param error etc.

Sample below shows how to properly handle exceptions:

Sync API

The following sample code shows how to perform a full synchronization flow using high-level wrapper.

First of all you need an instance of \BaseCRM\Client. High-level \BaseCRM\Sync wrapper uses \BaseCRM\SyncService to interact with the Sync API. In addition to the client instance, you must provide a device’s UUID within $deviceUUID parameter. The device’s UUID must not change between synchronization sessions, otherwise the sync service will not recognize the device and will send all the data again.

Now all you have to do is to call fetch method and pass a block that you might use to store fetched data to a database.

Notice that you must call either #ack or #nack method.

Resources and actions

Documentation for every action can be found in corresponding service files under lib/ directory.

Account

Actions:

AssociatedContact

Actions:

Contact

Actions:

Deal

Actions:

Note about deal value

You can use either a string or numerical deal value when modifying a deal.

Deal Source

Actions:

Lead

Actions:

Lead Source

Actions:

Line Item

Actions:

LossReason

Actions:

Note

Actions:

Order

Actions:

Pipeline

Actions:

Product

Actions:

Source (Deprecated! Use Lead Source, Deal Source instead)

Actions:

Stage

Actions:

Tag

Actions:

Task

Actions:

TextMessage

Actions:

User

Actions:

Visit

Actions:

VisitOutcome

Actions:

Tests

Install PHPUnit via Composer:

To run all test suites:

And to run a single suite:

Bug Reports

Report here.

Copyright and license

Copyright 2015 Zendesk

Licensed under the Apache License, Version 2.0


All versions of basecrm-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package basecrm/basecrm-php contains the following files

Loading the files please wait ....