Download the PHP package coreproc/chikka-api-sdk without Composer

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

Chikka API SDK for PHP

A PHP library for interacting with the Chikka API for sending and receiving SMS.

Note: This is not an official Chikka library

Install

Run the following command at the root of your project (assuming you have Composer and a composer.json file already)

Usage

Sending SMS

Basic sending of an SMS can be summarized in four steps:

  1. Instantiate a ChikkaClient object with your credentials and shortcode.
  2. Instantiate an Sms object with your desired message.
  3. Instantiate an SmsTransporter using the ChikkaClient and Sms objects you just created.
  4. Send using the SmsTransporter

Here is an example:

Determining the response of an SMS

The send() method of the SmsTransporter class returns an object containing the response from Chikka's server. A sample successful response is below:

A sample error response would be as follows:

However, determining the response of the SMS API from this standpoint would result in an archaic code base of and this would best be handled by a separate class.

You can implement an SmsTransporterActionsContract to a class to handle the responses. A sample class that implements SmsTransporterActionsContract is as follows:

The SmsTransporterActionsContract interface has four notable methods:

  1. onStart() method is called at the start of sending an SMS

  2. onInvalid() method is called when the SMS being sent is invalid. This usually means that one of your parameters are incorrect and resulted in a 400 response code from Chikka's server. Handle your SMS as necessary in this method. The Exception object passed here contains the code and the message of the response and you can get them by using $exception->getCode() and $exception->getMessage(), respectively.

  3. onError() method is called when a server exception is encountered. This usually means that the Chikka server responded with a 500 level response and your SMS was not successfully transmitted anywhere. You should probably try sending your SMS again if this occurs.

  4. onSuccess() method is called when an SMS was successfully accepted by Chikka's servers.

To use this SampleSmsTransporterActions class when sending an SMS, simply include it as the first parameter of the send() method. Here is an example:

Note: When using the send() method without a SmsTransporterActionsContract class, the default class that is used is Coreproc\Chikka\Transporters\SmsTransporterActions. You can use that class as a reference for creating your own SmsTransporterActionsContract class.


All versions of chikka-api-sdk with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ~6.0
vlucas/valitron Version ~1.2
nesbot/carbon Version ~1.14
coreproc/msisdn-ph Version 1.1.*
psr/log Version ~1.0.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 coreproc/chikka-api-sdk contains the following files

Loading the files please wait ....