Giter VIP home page Giter VIP logo

sdk-for-php's Introduction

SaralSMS SDK for PHP

The SaralSMS SDK for PHP makes it easy for developers to access SaralSMS API service in their PHP code, and build robust SMS based applications and software.

Getting Started

  1. Sign up for SaralSMS – Before you begin, you need to sign up for an SaralSMS account and retrieve your Credentials.
  2. Minimum requirements – To run the SDK, your system will need to meet the minimum requirements, including having PHP >= 7.2. We highly recommend having it compiled with the cURL extension and cURL compiled with a TLS backend (e.g., NSS or OpenSSL).

Installation

Install the SDK – Using Composer is the recommended way to install the SaralSMS SDK for PHP. The SDK is available via Packagist under the saralsms/sdk-for-php package.

composer require saralsms/sdk-for-php

Getting Help

We use the GitHub issues for tracking bugs and feature requests and address them as quickly as possible.

Quick Examples

Create a SaralSMS client

// require the composer autoloader.
require 'vendor/autoload.php';

use SaralSMS\Client;

// instantiate a SaralSMS client.
$client = new Client('f9c6......55c1');

Send Message

This will send the message to one or multiple numbers in an array.

$client->send(['9851xxx123', '9801xxx456'], 'This is test message from API.');

Sample Response

{
    "message": "2 messages queued for delivery."
}

Credits

This will return the available credits and total messages sent.

$client->getCredits();

Sample Response

{
  "credits": 6584,
  "total_sent": 3416
}

Reports

This will return historical messages reports including networks, charges and status.

$pageNumber = 1;
$client->getReports($pageNumber);

Sample Response

{
  "pages": 126,
  "data": [
    {
      "id": 56480058,
      "receiver": "9779851xxx123",
      "network": "ntc",
      "message": "Fruits are an excellent source of essential vitamins and minerals.",
      "api_credit": "1",
      "delivery_at": "2020-07-09 01:45:09"
    },
    {
      "id": 56480057,
      "receiver": "9779801xxx456",
      "network": "ncell",
      "message": "Vegetables are important sources of many nutrients, including potassium, dietary fiber.",
      "api_credit": "1",
      "delivery_at": "2020-07-08 07:25:31"
    }
  ]
}

sdk-for-php's People

Contributors

remotemerge avatar sapkotamadan avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.