Documentation - Messages


  1. Sending a SMS messages
  2. Canceling a SMS messages
  3. Getting a SMS message information
  4. Searching SMS messages

Messages - Getting a SMS message information

You can check the status and other information of any of your SMS messages using our API
Below is some sample requests and response. For complete API documentation on getting a sms message information please refer to the Swagger (Open API Specification) documentations here: SMS Gateway API Definition


API Request

Request Endpoint
Endpoint: https://smsgateway.me/api/v4/message/{id}
Method: GET
Request Parameters
Name Location Required Description
Authorization header true Your API token found on the settings page
id path true The ID of the message you are trying to fetch

Request Example

A GET request with the message id provided in the path

{
  "GET": "https://smsgateway.me/api/v4/message/123456"
}

Response Examples

Successful Response

A successful request will bring back message information

Response Code: 200

{
  "id": 123456,
  "device_id": 1,
  "phone_number": "07791064781",
  "message": "Hello World",
  "status": "canceled",
  "log": [
    {
      "status": "pending",
      "occurred_at": "2018-05-05T16:51:22+00:00"
    },
    {
      "status": "queued",
      "occurred_at": "2018-05-05T16:52:33+00:00"
    },
    {
      "status": "sent",
      "occurred_at": "2018-05-05T16:53:33+00:00"
    }
  ],
  "created_at": "2018-05-05T16:51:22+00:00"
}

Error Response

When a request can not be processed

Response Code: 40x | 500

{
  "status": "fail",
  "message": "Could not process request",
  "data": {
    "exception": "Error message"
  }
}

SDK Examples

You can use our Swagger generated PHP SDK to help integrate with our service. If you wish to use SMS Gateway Me with a different platform you may generate your own client using the swagger file.

Installation Instructions: PHP SMS Gateway SDK
Swagger Definition: SMS Gateway API Definition


Request Example

<?php

require 'vendor/autoload.php';

use SMSGatewayMe\Client\ApiClient;
use SMSGatewayMe\Client\Configuration;
use SMSGatewayMe\Client\Api\MessageApi;

// Configure client
$config = Configuration::getDefaultConfiguration();
$config->setApiKey('Authorization', 'your-token-here');
$apiClient = new ApiClient($config);
$messageClient = new MessageApi($apiClient);

// Get SMS Message Information
$message = $messageClient->getMessage(63402678);
print_r($message);

Successful Response

SMSGatewayMe\Client\Model\Message Object
(
    [id:protected] => 63402678
    [deviceId:protected] => 90295
    [message:protected] => test2
    [status:protected] => sent
    [log:protected] => Array
        (
            [0] => SMSGatewayMe\Client\Model\MessageLog Object
                (
                    [status:protected] => pending
                    [occurredAt:protected] => DateTime Object
                        (
                            [date] => 2018-05-14 21:13:07.000000
                            [timezone_type] => 1
                            [timezone] => +00:00
                        )
                )
        )

    [createdAt:protected] => DateTime Object
        (
            [date] => 2018-05-14 21:13:07.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updatedAt:protected] => DateTime Object
        (
            [date] => 2018-05-14 21:13:07.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )
)