Documentation - Messages - List Of Messages


  1. List of Messages
  2. Fetch Single Message
  3. Send message to number
  4. Send message to many number
  5. Send message to contacts
  6. Send message to many contacts
  7. Send many messages to many recipients

# List of messages

You can use the SMS Gateway API to get a list of your messages programmatically. These are messages both send and received using SMS Gateway API.


API Reference

API Endpoint
URL: http://smsgateway.me/api/v3/messages
Method: GET
Request Parameters
Parameter Required Description Default
email YES Your username for the site
password YES Your password for the site
page NO The page number (500 results per page) 1
Success Response
Status Code: 200 OK
Content Type: application/json
Output format: See Example

PHP Example

The below example uses the Android SMS Gateway API PHP library which is available for download - This library requires PHP CURL to be enabled.
Please note that although this is PHP example using the SMS Gateway library you may make requests in any language using the parameters above.

  • <?php
  • include "smsGateway.php";
  • $smsGateway = new SmsGateway('demo@smsgateway.me', 'password');

  • $page = 1;

  • $result = $smsGateway->getMessages($page);
  • ?>

The result will contain a associative multidimensional array. The first item being status which is the response code returned from the SMS Gateway API. The second item being response which will be the array version of the response examples of which can be found below.


Success Example

  • {
  • "success": true,
  • "result": {
    • "total": 2,
    • "per_page": 500,
    • "current_page": 1,
    • "last_page": 1,
    • "from": 1,
    • "to": 2,
    • "data": [
      • {
        • "id": "308",
        • "device_id": "4",
        • "message": "hello world!",
        • "status": "pending",
        • "send_at": "1414624856",
        • "queued_at": "0",
        • "sent_at": "0",
        • "delivered_at": "0",
        • "expires_at": "1414634856",
        • "canceled_at": "0",
        • "failed_at": "0",
        • "received_at": "0",
        • "error": "None",
        • "created_at": "1414624856",
        • "contact": {
          • "id": "14",
          • "name": "Phyllis Turner",
          • "number": "+447791064713"
        • }
      • },
      • {
        • "id": "176",
        • "device_id": "4",
        • "message": "hello world!",
        • "status": "queued",
        • "send_at": "1410780396",
        • "queued_at": "1410796253",
        • "sent_at": "0",
        • "delivered_at": "0",
        • "expires_at": "1410806253",
        • "canceled_at": "0",
        • "failed_at": "0",
        • "received_at": "0",
        • "error": "None",
        • "created_at": "1410780396",
        • "contact": {
          • "id": "17",
          • "name": "Ruben James",
          • "number": "+447791064716"
        • }
      • }
    • ]
  • }
  • }