+(923) 111 88 4444
TecniForge, 79/5-L, Sahiwal 57000

SMS – Get Sent Messages

SMS – Get Sent Messages

Get Sent Messages. Requires “get_sms_sent” API permission.GET https://androidapi.net/api/get/sms.sent

Parameter #

FieldTypeDescription
secretStringThe API secret you copied from (Tools -> API Keys) page
limit (optional)NumberLimit the number of results per page.Default value: 10
page (optional)NumberPagination of results.Default value: 1

Success Response Format #

FieldTypeDescription
statusNumberList of Codes
200 = Success
messageStringResponse message
dataArrayArray of data

Error Response Format #

NameTypeDescription
statusNumberList of Codes
400 = Invalid parameters
401 = Invalid API secret
403 = Access denied
500 = Something went wrong
messageStringResponse message
dataArrayArray of data

PHP Sample #

<?php

  $apiSecret = "API_SECRET"; // your API secret from (Tools -> API Keys) page

  $cURL = curl_init();
  curl_setopt($cURL, CURLOPT_URL, "https://androidapi.net/api/get/sms.sent?secret={$apiSecret}");
  curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
  $response = curl_exec($cURL);
  curl_close($cURL);

  $result = json_decode($response, true);

  // do something with response
  print_r($result);

Python Sample #

import requests

# your API secret from (Tools -> API Keys) page
apiSecret = "API_SECRET"

r = requests.get(url = "https://androidapi.net/api/get/sms.sent", params = {
    "secret": apiSecret
})
  
# do something with response object
result = r.json()

Successful Response #

{
  "status": 200,
  "message": "Sent SMS Messages",
  "data": [
       {
           "id": 1,
           "mode": "Devices",
           "sender": "00000000-0000-0000-d57d-f30cb6a89289",
           "sender_type": "device",
           "sim": 2,
           "priority": false,
           "api": false,
           "status": "sent",
           "status_code": "SMS_SENT",
           "recipient": "+639206150513",
           "message": "Hello World!",
           "created": 1644382599
       },
       {
           "id": 2,
           "mode": "Devices",
           "sender": "00000000-0000-0000-d57d-f30cb6a89289",
           "sender_type": "device",
           "sim": 2,
           "priority": false,
           "api": false,
           "status": "sent",
           "status_code": "SMS_SENT",
           "recipient": "+639184661533",
           "message": "Hello World!",
           "created": 1644382597
       },
       {
           "id": 3,
           "mode": "Credits",
           "sender": "Twilio",
           "sender_type": "gateway",
           "sim": 0,
           "priority": false,
           "api": false,
           "status": "sent",
           "status_code": "",
           "recipient": "+639206150513",
           "message": "Hello World!",
           "created": 1644382807
       }
   ]
}

Error Response #

{
  "status": 400,
  "message": "Invalid Parameters!",
  "data": false
}

Leave A Comment