CallFire Solutions

06. List Keywords Owned By Your Account

Follow

This endpoint, similar to the list numbers endpoint, allows for querying and retrieving the full list of keywords owned by an account.

Endpoint

https://www.callfire.com/api/1.1/rest/number/keyword

Request Type

GET

Request Headers

Content-Type application/xml
Accepts application/xml

Returns

Requests to this endpoint will return an XML payload containing the list of keywords linked to the account being queried.

Request Arguments

ArgumentTypeDescription
MaxResults long required - Default: 1000.
The maximum number of results to return.
FirstResult long Default: 0.
The starting record number for the next recordset.

Example Request

Curl

curl -i https://www.callfire.com/api/1.1/rest/number/keyword?MaxResults=5&FirstResult=0 \
  -H "Accept: application/xml" \
  --user <YOUR_LOGIN>:<YOUR_PASSWORD>

PHP SDK

<?php

$configureKeyword = new Request\QueryKeywords();
$response = $callfireNumberClient->QueryKeywords(
    $configureKeyword
);
$keywords = $callfireNumberClient::response($response);

Node.js

var querystring = require('querystring');
var https = require('https');

var endpoint = '?' + querystring.stringify({
    MaxResults: 2
});

// Initialise the request parameters
var options = {
    host: 'www.callfire.com',
    path: '/api/1.1/rest/number/keyword',
    auth: 'YOUR_LOGIN' + ':' + 'YOUR_PASSWORD'
};

var req = https.request('PUT', options, function(res) {
    res.on('data', function(d) {
        process.stdout.write(d);
    });
}).on('error', function(e) {
    console.error(e);
});

req.end();

Go

requestOptions := callfire.CallFireRequestOptions{
    Url:            "https://www.callfire.com/api/1.1/rest/number/keyword?",
    Login:          "YOUR_LOGIN",
    Secret:         "YOUR_PASSWORD",
    ReqType:        "GET",
    RequestOptions: "MaxResults=2",
}
client, req := callfire.InitHttpClient(requestOptions)
resp, err := client.Do(req)

Response Arguments

ArgumentTypeDescription
ShortCode int The shared shortcode to which the keyword is bound.
Keyword string The keyword.
Status string The status of the number. Status can be one of: ACTIVE, PENDING, RELEASED,UNAVAILABLE
LeaseBegin date The date which the lease (or purchase) starts on, in the format YYYY-MM-DDT.
LeaseEnd date The date which the lease (or purchase) ends on, in the format YYYY-MM-DDT.
AutoRenew boolean Whether the purchase will auto-renew every month, automatically.

Example Response

Successful Without Results

HTTP/1.1 200 OK
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<r:ResourceList xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource" totalResults="0"/>

Successful With Results

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<r:ResourceList xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource" totalResults="2">
      <Keyword>
            <ShortCode>67076</ShortCode>
            <Keyword>YELLOWTAXI</Keyword>
            <Status>ACTIVE</Status>
            <LeaseInfo>
                  <LeaseBegin>2015-02-12Z</LeaseBegin>
                  <LeaseEnd>2015-03-11Z</LeaseEnd>
                  <AutoRenew>true</AutoRenew>
            </LeaseInfo>
      </Keyword>
      <Keyword>
            <ShortCode>67076</ShortCode>
            <Keyword>ORANGEBROADSWORD</Keyword>
            <Status>ACTIVE</Status>
            <LeaseInfo>
                  <LeaseBegin>2015-02-12Z</LeaseBegin>
                  <LeaseEnd>2015-03-11Z</LeaseEnd>
                  <AutoRenew>true</AutoRenew>
            </LeaseInfo>
      </Keyword>
</r:ResourceList>

 

Have more questions? Submit a request

Comments