Get the list of recipients who have clicked on your tracked link.


We created a new viewing experience for our SMS API documentation. It's now all in one central location. Click here to check it out!


Parameter

Description

Required

message_idMessage IDYES


Example


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


JSON Response

{
  "page": {
     "count": 1,
      "number": 1
  },
  "total": 2,
  "message_id": 54295,
  "link_hits": [
     {
       "mobile": 61412345678,
       "firstname": "",
       "lastname": "",
       "short_link": "TapTh.is/a1BCd2",
       "link_hits": 2
     },
     {
       "mobile": 61498765432,
       "firstname": "",
       "lastname": "",
       "short_link": "TapTh.is/e3FGh4",
       "link_hits": 1
     }
   ],
   "error": {
     "code": "SUCCESS",
     "description":"OK"
   }
}

XML Response

<? xml version="1.0"encoding="UTF-8"?>
<response>
  <page>
    <count>1</count>
    <number>1</number>
  </page>
  <total>2</total>
  <message_id>54925</message_id>
  <link_hits>
    <item>
      <mobile>61412345678</mobile>
      <firstname/>
      <lastname/>
      <short_link>TapTh.is/a1BCd2</short_link>
      <link_hits>2</link_hits>
    </item>
    <item>
      <mobile>61498765432</mobile>
      <firstname/>
      <lastname/>
      <short_link>TapTh.is/e3FGh4</short_link>
      <link_hits>1</link_hits>
    </item>
  </link_hits>
  <error>
    <code>SUCCESS<code/>
        <description>OK<description/>
   </error>
</response>


PHP Examples


<?php
 include '../../APIClient2.php';
 
 $api = new transmitsmsAPI('API_KEY', 'API_SECRET');
 $messageID = 123;
 $result = $api->getLinkHits($messageID);
 
 if ($result->error->code == 'SUCCESS') {
   echo var_export($result,true);
 
 } else {
   echo 'Error: . $result->error->description;
 }
?>