2017 © Pedro Peláez
 

library lib-api-php

Library to connect to Twizo to send SMS, Number Lookup or Verifications

image

twizo/lib-api-php

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  • Wednesday, May 2, 2018
  • by Twizo Admin
  • Repository
  • 5 Watchers
  • 3 Stars
  • 438 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 16 Versions
  • 4 % Grown

The README.md

Twizo, (*1)

Twizo PHP API

Connect to the Twizo API using PHP. This API includes functions to send verifications (2FA), SMS and Number Lookup., (*2)

Requirements

  • PHP >= 5.4
  • Composer

Get application secret and api host

To use the Twizo API client, the following things are required:, (*3)

Installation

The easiest way to start using the the Twizo API is to require it with Composer., (*4)

$ composer require twizo/lib-api-php

Getting started

Use the auto loader to load all required classes. If you're using Composer, you can skip this step and use the composer auto loader., (*5)

require "autoload.php";

Initializing the Twizo Api using your api secret and api host, (*6)

$twizo = Twizo\Api\Twizo::getInstance('43reFDSrewrfet425rtefdGDSGds54twegdsgHaFST2refwd', 'api-asia-01.twizo.com');

Create a new verification, (*7)

$verification = $twizo->createVerification('610123456789');
$verification->send();

Verify token, (*8)

try {
    $result = $twizo->getTokenResult($verification->getMessageId(), '12345');

    print 'Success' . PHP_EOL;
} catch (Verification\Exception $e) {
    print 'Failed: ' . $e->getMessage() . PHP_EOL;
} catch (Twizo\Api\Exception $e) {
    print 'Exception: ' . $e->getMessage() . PHP_EOL;
}

Send sms, (*9)

$sms = $twizo->createSms('test message body', '610123456789', 'sender');
$sms->sendSimple();

Examples

In the examples directory you can find a collection of cli examples of how to use the api. When first running an example you will be asked for a host name and secret; this will be written to a config file., (*10)

License

The MIT License. Copyright (c) 2016-2017 Twizo, (*11)

Support

Contact: www.twizo.com — support@twizo.com, (*12)

The Versions

02/05 2018

dev-master

9999999-dev https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *
  • php ^5.4|^7.0

 

by Twizo

02/05 2018

0.13.0

0.13.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • php ^5.4|^7.0
  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *

 

by Twizo

25/04 2018

0.12.0

0.12.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • php ^5.4|^7.0
  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *

 

by Twizo

24/04 2018

0.12.1

0.12.1.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • php ^5.4|^7.0
  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *

 

by Twizo

03/01 2018

0.11.0

0.11.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • php ^5.4|^7.0
  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *

 

by Twizo

30/11 2017

0.10.0

0.10.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • php ^5.4|^7.0
  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *

 

by Twizo

24/11 2017

0.9.0

0.9.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • php ^5.4|^7.0
  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *

 

by Twizo

31/10 2017

0.8.0

0.8.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • php ^5.4|^7.0
  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *

 

by Twizo

25/10 2017

0.7.0

0.7.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • php ^5.4|^7.0
  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *

 

by Twizo

28/09 2017

0.6.0

0.6.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

  • php ^5.4
  • ext-curl *
  • ext-json *
  • ext-openssl *
  • ext-spl *

 

by Twizo

05/07 2017

0.5.0

0.5.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

 

by Twizo

22/06 2017

0.4.1

0.4.1.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

 

by Twizo

14/06 2017

0.4.0

0.4.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

 

by Twizo

13/06 2017

0.3.0

0.3.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

 

by Twizo

26/04 2017

0.2.0

0.2.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

 

by Twizo

02/03 2017

0.1.0

0.1.0.0 https://www.twizo.com/

Library to connect to Twizo to send SMS, Number Lookup or Verifications

  Sources   Download

MIT

The Requires

 

by Twizo