Get a list of existing keywords.


Parameter

Description

Required

numberFilter the list by virtual numberNO
pagePage number, for paginationNO
maxMaximum results returned per pageNO



Example: Get keywords on a particular number


curl https://api.transmitsms.com/get-keywords.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d number=61491570157


JSON Response

{
  keywords_total: 74,
  keywords: [
  {
    keyword: "NEWS",
    reference: "Gym news",
    number: "61491570156",
    status: "active",
    billing_date: "2013-05-21",
    list_id: 0,
    welcome_message: "Welcome to Mike's gym news",
    members_message: "Thanks for your continued support",
    forward_url: "http://example.com/gym-promo",
    forward_email: "news@example.com,mike@example.com",
    forward_sms: "61491570157,61491570158"
  }
  ],
  page: {
    count: 1,
    number: 1
  }
}

XML Response

<?xmlversion="1.0"encoding="UTF-8"?>
<response>
  <keywords_total>74</keywords_total>
  <keywords>
    <keyword>NEWS</keyword>
    <reference>Gym news</reference>
    <number>61491570156</number>
    <status>active</status>
    <billing_date>2013-05-21</billing_date>
    <list_id>0</list_id>
    <welcome_message>Welcome to Mike&amp;#39;s gym news</welcome_message>
    <members_message>Thanks for your continued support</members_message>
    <forward_url>http://example.com/gym-promo</forward_url>
    <forward_email>news@example.com,mike@example.com</forward_email>
    <forward_sms>61491570157,61491570158</forward_sms>
  </keywords>
  <page>
    <count>1</count>
    <number>1</number>
  </page>
</response>


PHP Examples


<?php
 include '../../APIClient2.php';
 
 $api = new transmitsmsAPI('API_KEY', 'API_SECRET');
 $offset = 0;
 $limit = 10;
 $result = $api->getKeywords('6140000000', $offset,$limit);

 if ($result->error->code == 'SUCCESS') {
     echo "There are {$result->keywords_total} keywords, showing page {$result->page->number} of {$result->page->count} <hr>";
     
     foreach ($result->keywords as $keyword) {
         echo "{$keyword->keyword} - {$keyword->status} <br>";
     }

 } else {
     echo "Error: {$result->error->description}";
 }