BulkGate Helpdesk
  • Languages iconEnglish
    • Čeština

›Delivery confirmations and incoming SMS

API administration

  • API administration

API tokens

  • API tokens

Delivery confirmations and incoming SMS

  • Delivery confirmations and incoming SMS
  • Bulk delivery confirmation of incoming messages

Api limits

  • Api limits
  • Api request limits

Delivery confirmations and incoming SMS

Delivery confirmations and incoming SMS (answers)

Delivery reports are sent to DELIVERY_URL via HTTP method GET. See the table of parameters for this command. See also “AppID” in the table of parameters.

Delivery confirmation: Parameters

PARAMETER NAMEDESCRIPTIONpovinný
statusSee the table with delivery confirmation statusYes
smsIDUnique smsID of messageNo
toPhone number of the recipient in international format without the "+" (e.g. 420777777777)No
pricePrice of SMS in creditsNo
channelChannel used to deliver messageNo
dateSending and receiving time (CET timezone), e.g.: 1812141317;1812141318 (14th December 2018, 13:17 and 14th December 2018, 13:18)No
fromOnly if status=10, ID of sender in incoming SMS in international formatNo
messageOnly if status=10, Text of incoming SMS in UTF-8 encodingNo

Delivery confirmation: Status

STATUSDESCRIPTION
1SMS successfully delivered
2SMS buffered on SMSC. SMS will be delivered later. Recipient is unavailable.
3SMS not delivered. Unknown/unavailable recipient.
10Incoming SMS or SMS answer (contact us for more information)
13Message seen (Viber only)

Delivery confirmation: Status 10 (Incoming SMS or SMS answer)

PARAMETER NAMEDESCRIPTION
statusStatus = 10
smsdetailsSMS details including protocol used along with received date and time
fromSenders phone number
channelChannel used to deliver message
toRecipient's phone number
messageText of incoming SMS in UTF-8 encoding
udhuser data header

PHP 5.4 procedural

<?php
$status_list = [
    1 => 'delivered',
    2 => 'unavailable',
    3 => 'not_delivered'
];

$status = filter_input(INPUT_GET, 'status', FILTER_SANITIZE_NUMBER_INT);

if($status && (int) $status === 10)
{
    $from    = filter_input(INPUT_GET, 'from', FILTER_SANITIZE_STRING);
    $message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_STRING);

    file_put_contents(__DIR__."/inbox.log", '['.date('Y-m-d H-i-s').'] ' .sprintf('From: [%s] Message: [%s]', $from, $message) . PHP_EOL,FILE_APPEND);
    exit(0);
}
elseif($status && in_array((int)$status, array_keys($status_list)))
{
    $price  = filter_input(INPUT_GET, 'price', FILTER_SANITIZE_NUMBER_FLOAT);
    $sms_id = filter_input(INPUT_GET, 'smsID', FILTER_SANITIZE_STRING);

    file_put_contents(__DIR__."/delivery.log", '['.date('Y-m-d H-i-s').'] ' .sprintf('Message ID [%s] is in the status [%s], Price: [%f]', $sms_id, $status_list[$status], $price) . PHP_EOL,FILE_APPEND);
    exit(0);
}
else
{
    echo "invalid status";
    exit(1);
}

PHP 7.1 object-oriented

<?php declare(strict_types=1);

class Delivery
{
    const STATUS_LIST = [
        1 => 'delivered',
        2 => 'unavailable',
        3 => 'not_delivered'
    ];

    public function __construct()
    {
        $status = $this->input('status', 'int');

        if($status === 10 /** INBOX */)
        {
            $this->inbox();
        }
        elseif(in_array($status, array_keys(self::STATUS_LIST)))
        {
            $this->delivery(self::STATUS_LIST[$status]);
        }
        else
        {
            $this->log('Unknown status: '.(string) $status, 'error');
        }
    }

    public function inbox(): void
    {
        $from    = $this->input('from');
        $message = $this->input('message');

        $this->log(sprintf('From: [%s] Message: [%s]', $from, $message), 'inbox');
    }

    public function delivery(string $status): void
    {
        $price  = $this->input('price', 'float');
        $sms_id = $this->input('smsID');

        $this->log(sprintf('Message ID [%s] is in the status [%s], Price: [%f]', $sms_id, $status, $price), 'delivery');
    }

    private function log(string $message, string $type): void
    {
        $message = '['.date('Y-m-d H-i-s').'] ' . $message . PHP_EOL;

        echo $message;
        file_put_contents(__DIR__."/$type.log", $message,FILE_APPEND);

        exit((int) $type === 'error');
    }

    private function input(string $name, string $type = 'string')
    {
        if($type === 'string')
        {
            $value = filter_input(INPUT_GET, $name, FILTER_SANITIZE_STRING);
            return $value ? (string) $value : '';
        }
        else if($type === 'int')
        {
            $value = filter_input(INPUT_GET, $name, FILTER_SANITIZE_NUMBER_INT);
            return $value ? (int) $value : 0;
        }
        else if($type === 'float')
        {
            $value = filter_input(INPUT_GET, $name, FILTER_SANITIZE_NUMBER_FLOAT);
            return $value ? (float) $value : 0.0;
        }

        return null;
    }
};

new \Delivery();
← API tokensBulk delivery confirmation of incoming messages →
  • Delivery confirmations and incoming SMS (answers)
    • Delivery confirmation: Parameters
    • Delivery confirmation: Status
    • Delivery confirmation: Status 10 (Incoming SMS or SMS answer)
    • PHP 5.4 procedural
    • PHP 7.1 object-oriented
SolutionsSMS GatewayViber for BusinessBroadcastBulk SMSSMS NotificationsTwo-way SMSMobile ConnectWeb Portal
Partners & DevelopersSMS APIIntegrationsAffiliate programWhite label
SourcesBlogYouTubeFacebookLinkedInTwitterGitHubPackagist
CompanyContactPrivacyTerms and Conditions
Price listsPrice list SMSPrice list ViberPrice list Mobile Connect
SMS GatewayTOPefekt s.r.o. © 2026