POSTS
PORTFOLIO
SEARCH
SHOP
  • Your Cart Is Empty!
Your address will show here +12 34 56 78
API command for developers
Looking for telecom solutions without needing a developer? Our user portal has you covered! 
  • Text Hover
Enabling and sending an SMS/MMS
There are three commands necessary for SMS, but keep in mind that SMS is only available for tier 1 and 1b DIDs.
First you must enable SMS with the smsManageDid() function. It takes two parameters:
    DID: the number you wish to enable
    Status(String): "enable" or "disable"

To utilize SMS you will need an email for the messages to go to. This is done with the smsManageEmailForward() command which also only takes two parameters:
    DID: the number you are using
    eMail(string): the email you will use (set empty to remove forwarding)
    An optional XMPP account username and password

Finally you will be able to send SMS messages using the smsSend() function. This takes three self-explanatory parameters:
    DIDFrom: the number you are using
    DIDTo: the number you are sending the message to
    message(string): the text message you wish to send
    An optional file path for MMS

You will need to setup your .php file like so:
<?php
require_once dirname(__FILE__) . '/qb_api/config.inc.php';
include dirname(__FILE__) . '/qb_api/qbapi.class.php';
$api = new QBapi();
FUNCTIONS GO HERE
?>


There are three different functions you may use. These functions will go where the bold text is above (FUNCTIONS GO HERE).

1. $api->smsManageDid(XXXXXXXXXX, ‘enable’);
The XXXXXXXXXX is the number you wish to enable. ‘enable’ can also be replaced with ‘disable’ to disable SMS messaging on the selected number.


2. $api->smsManageEmailForward(XXXXXXXXXX, ‘email to forward messages to’, ‘method’, ‘xmpp username’, ‘xmpp password’);
The XXXXXXXXXX is the number of your choosing. Then you will select the email you wish to forward SMS messages to.
Next is the method, there are 4 options:
none - Removes SMS forwarding
email - Email only
xmpp - XMPP only
both - Email and XMPP


3. $api->smsSend(number sending message from, number sending message to, ‘the message’, ‘file path of MMS’);
If you don’t want to send an MMS, then all you have to do is not include the file path and the comma before like so:
$api->smsSend(number sending message from, number sending message to, ‘the message’);


These functions can be used one at a time, at separate times, or all together at once. Here are some examples:

Enabling SMS:
<?php
require_once dirname(__FILE__) . '/qb_api/config.inc.php';
include dirname(__FILE__) . '/qb_api/qbapi.class.php';
$api = new QBapi();
$api->smsManageDid(XXXXXXXXXX, ‘enable’);
?>

Email Forwarding:
<?php
require_once dirname(__FILE__) . '/qb_api/config.inc.php';
include dirname(__FILE__) . '/qb_api/qbapi.class.php';
$api = new QBapi();
$api->smsManageEmailForward(XXXXXXXXXX, ‘email to forward messages to’, ‘method’, ‘xmpp username’, ‘xmpp password’);
?>

Sending SMS/MMS:
<?php
require_once dirname(__FILE__) . '/qb_api/config.inc.php';
include dirname(__FILE__) . '/qb_api/qbapi.class.php';
$api = new QBapi();
$api->smsSend(number sending message from, number sending message to, ‘the message’, ‘file path of MMS’);
?>

Enabling SMS, Email Forwarding, Sending SMS at the same time:
<?php
require_once dirname(__FILE__) . '/qb_api/config.inc.php';
include dirname(__FILE__) . '/qb_api/qbapi.class.php';
$api = new QBapi();
$api->smsManageDid(XXXXXXXXXX, ‘enable’);
$api->smsManageEmailForward(XXXXXXXXXX, ‘email to forward messages to’, ‘method’, ‘xmpp username’, ‘xmpp password’);
$api->smsSend(number sending message from, number sending message to, ‘the message’, ‘file path of MMS’);
?>