An open API service indexing awesome lists of open source software.

https://github.com/zerosdev/kirimwa-php-client

Client SDK Library for Kirimwa.cloud
https://github.com/zerosdev/kirimwa-php-client

Last synced: 6 months ago
JSON representation

Client SDK Library for Kirimwa.cloud

Awesome Lists containing this project

README

          

# KirimWA PHP Client
Client SDK Library for Kirimwa.cloud Server Application

## Requirements
- PHP 5.6+
- PHP JSON Extension
- [Guzzle, PHP HTTP Client](https://github.com/guzzle/guzzle)

## Installation

1. Run command

composer require zerosdev/kirimwa-php-client

### The following steps only needed if you are using Laravel

> For installation on Laravel 5.5+, **SKIP steps 2 & 3** because we have used the Package Discovery feature, Laravel will automatically register the Service Provider and Alias during installation.

2. Open your **config/app.php** and add this code to the providers array, it will looks like:

'providers' => [

// other providers

ZerosDev\KirimWA\Laravel\ServiceProvider::class,

],

3. Add this code to your class aliases array

'aliases' => [

// other aliases

'KirimWA' => ZerosDev\KirimWA\Laravel\Facade::class,

],

4. Run command

composer dump-autoload

5. Then

php artisan vendor:publish --provider="ZerosDev\KirimWA\Laravel\ServiceProvider"

6. Edit **config/kirimwa.php** and put your KirimWA Server information like API host and sender list

## Basic Usage

### Laravel Usage

```php
'http://yourwaserver.com',
'senders' => [
'6281234567890' => [
'host' => ':3001', // just place port number to follow 'default_host'
'key' => 'your api key here'
],
'6280987654321' => [
'host' => 'http://youranotherwaserver.com:3002', // or place full API host with port to use different host than the 'default_host'
'key' => 'your api key here'
],
]
]);

$kirimwa = new Client();
$kirimwa->sendText('6281234567890', 'This is message to be sent');

if( $kirimwa->hasError() ) {
echo $kirimwa->error();
}
else {
echo $kirimwa->response();
}
```