Download the PHP package talkylabs/reach-sdk without Composer

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

reach-php

Documentation

The documentation for the Reach API can be found here.

The PHP library documentation can be found here.

Versions

reach-php uses a modified version of Semantic Versioning for all changes. See this document for details.

Supported PHP Versions

This library supports the following PHP implementations:

Installation

You can install reach-php via composer or by downloading the source.

Via Composer

reach-php is available on Packagist as the talkylabs/reach-sdk package:

Test your installation

Here is an example of using the SDK to send a text message:

Without Composer

While we recommend using a package manager to track the dependencies in your application, it is possible to download and use the PHP SDK manually. You can download the full source of the PHP SDK from GitHub, and browse the repo if you would like. To use the SDK in your application, unzip the SDK download file in the same directory as your PHP code. In your code, you can then require the autoload file bundled with the SDK.

Warning It's okay to hardcode your credentials when testing locally, but you should use environment variables to keep them secret before committing any code or deploying to production.

Usage

Get a messagingItem

Iterate through records

The library automatically handles paging for you. Collections, such messagingItems, have read and stream methods that page under the hood. With both read and stream, you can specify the number of records you want to receive (limit) and the maximum size you want each page fetch to be (pageSize). The library will then handle the task for you.

read eagerly fetches all records and returns them as a list, whereas stream returns an iterator and lazily retrieves pages of records as you iterate over the collection. You can also page manually using the page method.

Use the read method

Enable Debug Logging

There are two ways to enable debug logging in the default HTTP client. You can create an environment variable called REACH_TALKYLABS_LOG_LEVEL and set it to debug or you can set the log level to debug:

Handle exceptions

When something goes wrong during client initialization, in an API request, reach-php will throw an appropriate exception. You should handle these exceptions to keep your application running and avoid unnecessary crashes.

The Reach client

For example, it is possible to get an authentication exception when initiating your client, perhaps with the wrong credentials. This can be handled like so:

CurlClient

When initializing the curl client, you will see an EnvironmentException if curl is not installed on your system.

ReachException

ReachException can be used to handle API errors, as shown below. This is the most common exception type that you will most likely use.

Debug API requests

To assist with debugging, the library allows you to access the underlying request and response objects. This capability is built into the default Curl client that ships with the library.

For example, you can retrieve the status code of the last response like so:

Use a custom HTTP Client

To use a custom HTTP client with this helper library, please see the advanced example of how to do so.

Docker image

The Dockerfile present in this repository and its respective talkylabs/reach-php Docker image are currently used by TalkyLabs for testing purposes only.

Getting help

If you've found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!


All versions of reach-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.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 talkylabs/reach-sdk contains the following files

Loading the files please wait ....