adedaramola/sendchamp-php-sdk

Sendchamp php sdk

v1.0.0 2022-08-30 13:01 UTC

This package is auto-updated.

Last update: 2024-11-08 06:45:16 UTC


README

Simple php package to work with Sendchamp API

Installation

This package requires PHP 8.0+ and Composer. Then require the package in your project like so:

composer require adedaramola/sendchamp-php-sdk

Usage

<?php

require __DIR__ '/../vendor/autoload.php';

use Adedaramola\Sendchamp\Sendchamp;

// For production environment, provide "live" as second argument
$sendchamp = new Sendchamp('api-public-key');

// Send sms
$sendchamp->sms()->send([
    'to' => ['+2348132644971'],
    'message' => 'This package is awesome',
    'sender_name' => 'Adedaramola',
    'route' => 'dnd'
]);

// Get sms delivery report
$sendchamp->sms()->getDeliveryReport('9173hqhb7837ydg');

// Get bulk sms delivery report
$sendchamp->sms()->getBulkDeliveryReport('9173hqhb7837ydg');

// Send otp
$sendchamp->otp()->send([
    'channel' => '',
    'sender' => '',
    'token_type' => '',
    'token_length' => 6
]);

// Verify otp
$sendchamp->otp()->verify($reference, $code);

// Get wallet balance
$sendchamp->wallet()->getBalance();

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance or add missing functionalities.

Support

Kindly leave a star on the repo, this makes me glad. Reach out on twitter

Adedaramola Adetimehin.