Get information about a message you have sent.


Parameter



Description



Required


message_idMessage ID
YES


 


Example


curl https://api.transmitsms.com/get-sms.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d message_id=48782

JSON Response



XML Response



{
    "message_id": 123456789,
    "send_at": "2018-04-19 00:29:32",
    "recipients": 1,
    "cost": 0.087,
    "sms": 1,
    "message": "Sample message",
    "list": {
        "id": 1234567,
        "name": "My Test List"
    },
    "delivery_stats": {
	"delivered": 1,
	"pending": 0,
	"bounced": 0,
	"responses": 0,
	"optouts": 0,
        },
    "error": {
	"code": "SUCCESS",
	"description": "OK",
    }
}


<?xmlversion="1.0"encoding="UTF-8"?>
<response>
  <message_id>123456789</message_id>
  <send_at>2018-04-19 00:29:32</send_at>
  <recipients>1</recipients>
  <cost>0.087</cost>
  <sms>1</sms>
  <message>Sample message</message>
  <list>
    <id>1234567</id>
    <name>My Test List</name>
  </list>
  <delivery_stats>
    <delivered>1</delivered>
        <pending>0</pending>
        <bounced>0</bounced>
        <responses>0</responses>
        <optouts>0</optouts>
  </delivery_stats>
  <error>
    <code>SUCCESS</code>
        <description>OK</description>
  </error>
</response>


 


PHP Examples


<?php
 include'../../APIClient2.php';
 $api=new transmitsmsAPI("API_KEY",'API_SECRET');
 
 $result=$api->getSms(49680);
 
 if($result->error->code=='SUCCESS')
 {
     echo"Message to {$result->recipients} recipients sent with 
     ID {$result->message_id}, cost {$result->cost}";
 }
 else
 {
     echo"Error: {$result->error->description}";
 }