Download the PHP package sendbee/api without Composer

On this page you can find all versions of the php package sendbee/api. 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 api

AI Number PHP API Client

Table of contents

Contacts

Contact Tags

Contact Fields

Conversations

Teams

Messages

Automation

Mics

Installation

The recommended way to install Sendbee API is with Composer.

1. Install Composer

2. Install Sendbee API using Composer

2.a Using Composer CLI

You can add Sendbee API as a dependency using the composer.phar CLI:

2.b Using global composer CLI

If Composer is available globally on your system, you can run the following from your project root.

2.c Modifying existing composer.json

If you have an existing project that uses Composer and has composer.json file, you can specify sendbee/api as a dependency.

After adding a dependency you should tell composer to update dependencies

Usage

Autoload

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

You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at Composer.

Initialization

To initialize the API client, you'll need a public key and secret. That data is available in your Sendbee dashboard.

Contacts

Fetch contacts

Subscribe contact

Update contact

Contact tags

Fetch tags

Create tag

Update tag

Delete tag

Contact fields

Fetch contact fields

Create contact field

Update contact field

Delete contact field

Conversations and messages

Fetch conversations

Fetch single conversation

update-single-conversation

Update a single conversation

Fetch messages in a conversation

Sending messages

Fetch message templates

Send template message

Send message

You can send either text message or media message.
For media message, following formats are supported:
Audio: AAC, M4A, AMR, MP3, OGG OPUS
video: MP4, 3GPP
Image: JPG/JPEG, PNG
Documents: PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX

Teams

Fetch teams

Fetch team members

Automation

Toggle bot for conversation with contact on off

Every contact is linked with conversation with an agent.
Conversation could be handled by an agent or a bot (automation).
Every time a message has been sent to a contact by an agent or using the API, the bot is automatically turned off for that conversation - except when you set 'prevent_bot_off' to true via API call (see Send message).

Use the example below to change the chatbot status based on your use case.

Get chatbot (automated responses) status

You can also check if chatbot is turned on or off for a conversation.

Misc

Response

All API methods return a Sendbee\Api\Transport\Response object. Only exception is when some required parameter is missing or there are network issues - in that case an exception is thrown.

The response object wraps the raw server response into corresponding objects and exposes methods to inspect received data.

Pagination

Pagination is available on all client methods that accept a page parameter. Those methods are:

To get the first page of results you can omit the page parameter or set it to 1

Calling API methods that get a list of resources will return a Sendbee\Api\Transport\Response object containing pagination. Calling getMeta() on it will return pagination information.

Exception handling

Sendbee API client for PHP will throw an Exception is some required data is missing or it is unable to connect to Sendbee. You should wrap API calls in a try-catch block and handle thrown exceptions.

You should only encounter 2 types of exceptions:

Authenticate webhook request

After activating your webhook URL in Sendbee Dashboard, we will start sending requests on that URL depending on which webhook type is linked with that webhook URL.
Every request that we make will have authorization token in header, like this:

To authenticate requests that we make to your webhook URL, take this token from request header and check it using Sendbee API Client:


All versions of api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
guzzlehttp/guzzle Version ^6.5
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 sendbee/api contains the following files

Loading the files please wait ....