PHPackages                             weezqydy/sematimeapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. weezqydy/sematimeapi

Abandoned → [elimuswift/sms](/?search=elimuswift%2Fsms)Extension[API Development](/categories/api)

weezqydy/sematimeapi
====================

Sematime API Gateway

v1.0.4(9y ago)316[1 issues](https://github.com/weezqyd/sematime-api/issues)MITPHPPHP &gt;=5.5.9

Since Apr 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/weezqyd/sematime-api)[ Packagist](https://packagist.org/packages/weezqydy/sematimeapi)[ RSS](/packages/weezqydy-sematimeapi/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (3)Used By (0)

Sematime Api gateway for php
============================

[](#sematime-api-gateway-for-php)

[![Build Status](https://camo.githubusercontent.com/924c7109880665b67c145792ef51b5aa569503b81dab4717e99d3fc11f282f70/68747470733a2f2f7472617669732d63692e6f72672f7765657a7179642f73656d6174696d652d6170692e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/weezqydy/sematimeapi)[![Latest Stable Version](https://camo.githubusercontent.com/0280b8264c42e157cc1cfcf0d4c320773a101c94188f1362f17ba2460a6eb858/68747470733a2f2f706f7365722e707567782e6f72672f7765657a717964792f73656d6174696d656170692f762f737461626c65)](https://packagist.org/packages/weezqydy/sematimeapi) [![Total Downloads](https://camo.githubusercontent.com/55df753f2ecb16cf44ef9ecb8e3e881ebe1139355e9bbc45c812d15112135fa5/68747470733a2f2f706f7365722e707567782e6f72672f7765657a717964792f73656d6174696d656170692f646f776e6c6f616473)](https://packagist.org/packages/weezqydy/sematimeapi) [![Latest Unstable Version](https://camo.githubusercontent.com/346a29e43a79c7ff0b3a61636134c5839608a0726088424f0ba9a69f0c050d24/68747470733a2f2f706f7365722e707567782e6f72672f7765657a717964792f73656d6174696d656170692f762f756e737461626c65)](https://packagist.org/packages/weezqydy/sematimeapi) [![License](https://camo.githubusercontent.com/c518728fbd071bca7fb96cebecbd6ef81405660cea73afbb35839cf5b16f0bc0/68747470733a2f2f706f7365722e707567782e6f72672f7765657a717964792f73656d6174696d656170692f6c6963656e7365)](https://packagist.org/packages/weezqydy/sematimeapi)

This is a php package that you can easily intergarate into your project to send SMS Messages using the awesome Sematime API, to start using this package require it in your project using composer a php Dependency management tool. if you dont have composer installed head over to [Composer](http://getcomposer.org/download) and install

To include this package in your project add this to your composer.json and then run composer update

```
    {
        "require": {
            "weezqydy/sematimeapi": "~1.0"
        }
    }

```

### Introduction

[](#introduction)

The Sematime API makes it possible for you to send branded and personalized SMS messages from your php application. In addition, the API also exposes contacts management functions that let you can store, edit or delete contacts on behalf of your users.

Before you get started with the API, we will need you to do the following:

### Creating a free Sematime account

[](#creating-a-free-sematime-account)

A Sematime account is needed before you can start using our API. If you do not have a Sematime account already, go to [Sematime](http://sematime.elasticbeanstalk.com/register) and get yourself an account.

#### Getting your API credentials

[](#getting-your-api-credentials)

- To interact with sematime API, you will need to have an API key and the user ID of your Sematime account. We use these credentials to authenticate your requests.
- Login to your Sematime account and then click on the ‘My Account’ drop-down menu on your top right corner, choose ‘API Integration’ and then click on the ‘Generate Key’. You will be assigned a 32 character long API Key plus the accompanying user ID.

### Getting Started

[](#getting-started)

- Now at the root of yor project create a new file and name it .env
- In the file you just created add your API key and User Id as follows

```
API_KEY = "your-sematime-api-key"
USER_ID = "user-id-from-sematime"

```

### Messages

[](#messages)

#### Sending Messages

[](#sending-messages)

With everything configured properly, we are now ready to send our first message using sematime

```
// Include the composer autoloader if its not included yet
require __DIR__.'/vendor/autoload.php';
        use Sematime\Api\Sematime;
        // An Array of recipients
        $recipients = ['1234567890','0987654321','6789054321'];
        // Initialize The Sematime Api
        $gateway = new Sematime();
        //Create Your Message
        $message='A nice message send using Sematime';
        $results = $gateway->AddTo($recipients)->message($message)->send();
        // if evrything goes well you will get a response from Sematime
        echo $results;

```

You can optionally add other parameterss while building your message

- salutation() – an optional parameter whose value is the salutation type to use. When provided, each recipient will receive a personalized message beginning with the salutation followed by their name. For example: Dear Admin, Dear Lucy, Dear Jean etc in which case the salutation is the word ‘Dear

```
     //you can chain the parameters in any order
    $sema->message('message to send')->addTo(['1234567890'])->salutation('Dear')->send();
```

- signature() - an optional parameter whose value is a unique message that is attached at the end of all the messages that you send. For example, Sent by The Sematime team. Call 0706129100 .
- scheduledTime() – an optional parameter whose value is the date and time in milliseconds when you want the message to be sent out on a future date.
- senderId() – an optional parameter whose value is the sender ID / brand that will be used to send your message. If not specified, your Sematime account’s sender Id will be used instead.
- callbackUrl() – an optional parameter whose value is the URL that we will call in order to pass the delivery report after sending a scheduled message. All callbacks are invoked via HTTP POST.
- extra() – an optional parameter containing additional parameters that you may need to pass on to our API for later processing by your system. For example, account numbers, user Ids, etc. We don’t process these parameters and will pass them to you when invoking your callback.

```
  // all these methods are chainable
    $sema->signature('Sent by The Sematime team. Call 0706129100')
         ->senderId('Sematime') // Use this option only if you have an existing  ID
         ->scheduledTime('1466683660000') // Must be a future timestamp
         ->callbackUrl('https://api.mydomain.com/callback') // must be an existing and Valid URL
         ->extra('extra=extra data') // Only accepts strings
         ->addTo(array('1234567890')) // addTo expects an array of recipients
         ->message('an awesome message')
         ->send(); // send the message
```

#### Geting Scheduled Messages

[](#geting-scheduled-messages)

To retreive Scheduled messages

```
    $sema = new Sematime\Api\Sematime();
    $scheduled= $sema->getAllScheduled(); // returns the first 20 scheduled messages

    /* retrieve more scheduled messages or retrieve from a certain point.*/
    $startFrom = 15;
    $fetch=40;
    // retrieves 40 messages starting form the 15th
     $scheduled= $sema->getAllScheduled($fetch, $startFrom);
     print $scheduled;
```

### Contacts

[](#contacts)

Sematime organizes contacts into groups. A group will usually contain the contacts of people who share some relationship. For example, group ‘Sales Team’ would be a group for the members of the company’s sales team.

#### Adding Contacts

[](#adding-contacts)

We can also add contacts to your sematime account, just prepare your contact and then save it

```
   require __DIR__.'/vendor/autoload.php';
       use Sematime\Api\Sematime;
       // Initialize The Sematime Api
       $sema = new Sematime();
       $response=$sema->groupName('My Group') // the group name you wish to add contacts
                      ->addId('1') // contact id for the contact you want to add
                      ->addName('John Doe') // a name for your contact
                      ->addPhone('1234567890') // phone number you wish to add
                      ->save(); // finally save your contact
         print  $response; // {"statusCode":200, "description":"Contacts added successfully.","totalContacts":1, "contactsAdded":1}
```

#### Retreiving Contacts

[](#retreiving-contacts)

- Getting contacts from a group - Provide the group name for the contacts you want to retreive

```
    use Sematime/Api/Sematime;

    $sema= new Sematime();
    $group = 'My Group'; // The group you want to get contacts;
    $contacts= $sema->getGroupContacts($group); // you will get a json formated string of your contacts
```

- Getting an Individual contact from a group - Pass in the contactId as the first parameter followed by the groupName

```
    use Sematime/Api/Sematime;

    $sema= new Sematime();
    $group = 'My Group'; // The group you want to get contacts;
    $contactId= '14578652';
    $contacts= $sema->getContacts($contactId, $group); // you will get a json formated string of the contact
```

#### Editing Contacts

[](#editing-contacts)

To edit your contact all you need to do is provide your new name or new phone number for that contact

```
    use Semamatime/Api/Sematime;

    $sema= new Sematime();

    $contactId = '145367'; // provide the contact id to edit this required
    $groupName = 'My Group'; // The group in which the contact exists this is required
    $newName = 'David Clerk'; // New name for contact optional
    $newPhoneNumber = '1234567890';  // New phone Number to the contact, optional

    $response= $sema->editContact($constactId, $group, $newName, $newPhoneNumber);
     echo $response; // Contact updated successfully.

```
#### Deleting Contacts
Deleting a contact only requires you to provide the group and ID of the contact you wish to delete

```php
 use Semamatime/Api/Sematime;

    $sema= new Sematime();

    $contactId = '145367'; // provide the contact id to edit this required
    $groupName = 'My Group'; // The group in which the contact exists this is required

    $response = $sema->deleteContact($contactId, $group);
    echo $response; // Contact Deleted successfully
```
#### Account details
To retrieve your account details
```php
use Semamatime/Api/Sematime;

    $sema= new Sematime();

    $response = $sema->accountDetails();

    echo $response //{"account":{"accountId":"xxxxxxxxxxxxx", "name":"Your Name", "phoneNumber":"123456789", "smsBalance":0, "accountType":"school", "senderId":"Sematime", "paymentPlan":"prepaid", "createdOn":"Wed, 09\/09\/2015 04:59 PM"}, "statusCode":200, "description":"Account profile retrieved successfully."}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~181 days

Total

2

Last Release

3491d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e96a8fb006579076bb41b7d543654038bb9ea28addeb9ac685daee5011195eb3?d=identicon)[weezqyd](/maintainers/weezqyd)

---

Top Contributors

[![weezqyd](https://avatars.githubusercontent.com/u/11520842?v=4)](https://github.com/weezqyd "weezqyd (66 commits)")

### Embed Badge

![Health badge](/badges/weezqydy-sematimeapi/health.svg)

```
[![Health](https://phpackages.com/badges/weezqydy-sematimeapi/health.svg)](https://phpackages.com/packages/weezqydy-sematimeapi)
```

###  Alternatives

[netflie/whatsapp-cloud-api

The first PHP SDK to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform

640431.7k4](/packages/netflie-whatsapp-cloud-api)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[lucianotonet/groq-php

A powerful PHP library for seamless integration with the GroqCloud API

83124.5k6](/packages/lucianotonet-groq-php)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[unicodeveloper/jusibe-php-lib

Jusibe PHP Library

3417.4k1](/packages/unicodeveloper-jusibe-php-lib)[hardcastle/xrpl_php

PHP SDK / Client for the XRP Ledger

129.7k5](/packages/hardcastle-xrpl-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
