Get contact information from a list.


Parameter

Description

Required

list_idID of the list the contact is on.YES
msisdnMobile number of the contact.YES


Example


curl https://api.transmitsms.com/get-contact.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d list_id=1234567 \
  -d msisdn=61491570158 


JSON Response

XML Response


{
    "list_id": 1234567,
    "msisdn": "61491570158",
    "first_name": "John",
    "last_name": "Smith",
    "created_at": "2018-04-16 09:00:00",
    "status": "active",
    "fields": {
        "Email": "example@domain.com",
        "Suburb": "Smithfield"
    },
    "error": {
		"code": "SUCCESS",
		"description": "OK"
        }
}
<?xmlversion="1.0"encoding="UTF-8"?>
<response>
  <list_id>1234567</list_id>
  <msisdn>61491570158</msisdn>
  <first_name>John</first_name>
  <last_name>Smith</last_name>
  <created_at>2018-04-16 09:00:00</created_at>
  <status>active</status>
  <fields>
    <email>example@domain.com</email>
    <suburb>Smithfield</suburb>
  </fields>
  <error>
    <code>SUCCESS</code>
        <description>OK</description>
  </error>
</response>


PHP Examples


<?php
 include'../../APIClient2.php';
 $api = new transmitsmsAPI("API_KEY",'API_SECRET');
 $api->url = 'https://api.transmitsms.com/';
 
 $msidsn = '61491570158';
 $list_id = '1234567';
 
 $result = $api->getContact($list_id,$msidsn,);

 if($result->error->code=='SUCCESS')
 {
     echo var_export($result,true);
 }
 else
 {
     echo 'Error: '. $result->error->description;
 }