Monday, October 07, 2024
Innovative SMS Gateway & Messaging solutions

3rd-Party Solutions

PHP Class for aspsms.com

Within an ongoing project, Indielab GmbH has developed a PHP interface to send text messages via the ASPSMS SOAP Webservice.

Because of the following reasons Indielab GmbH chose ASPSMS as service provider:

  • Service based in Switzerland
  • worldwide network coverage
  • long term expert knowledge

Goals and Features

  • quick integration into own projects
  • easy examples
  • simple usage
  • reduced to core functionality

The PHP class is for free download and further development available OpenSource on the platform Github.com.

Project on Github

https://github.com/nadar/aspsms

Zip Download

Zip Download (via Github)


Example

<?php
    // include library
    include 'lib/aspsms.class.php';

    // init aspsms class with originator option
    $aspsms = new Aspsms("YOUR_KEY", "YOUR_PASSWORD", array(
        "Originator" => "MY_SENDER_NAME"
    ));

    // set the message and recipients with tracking numbers.
    $send = $aspsms->sendTextSms('YOUR_SMS_MESSAGE', array(
        'TRACKING_NR1' => 'MOBILE_PHONE_NR1',
        'TRACKING_NR2' => 'MOBILE_PHONE_NR2',
        'TRACKING_NR3' => 'MOBILE_PHONE_NR3'
    ));

    // check for sending errors
    if (!$send) {
        echo "Aspsms error while sending: " . $aspsms->getSendStatus();
    }

    // script needs to sleep 10 seconds, because the delivery takes some time
    sleep(10);

    // check status after 10 seconds
    $status1 = $aspsms->deliveryStatus('TRACKING_NR1');
    $status2 = $aspsms->deliveryStatus('TRACKING_NR2');
    $status3 = $aspsms->deliveryStatus('TRACKING_NR3');

    var_dump($status1, $status2, $status3);
?>

Old Version: https://github.com/nadar/aspsms-php-class, Zip Download (via Github)

Available SMS tools and interfaces for ASPSMS