CallFire Solutions

07. Search For Keywords Available For Purchase

Follow

This endpoint allows for determining if one or more keywords are available for purchase. This endpoint can be used in conjunction with the Create Number Order endpoint to make an order for the desired keywords.

Endpoint

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

Request Type

GET

Request Headers

Content-Type application/xml
Accepts application/xml

Returns

A query to this endpoint returns an XML response containing a list of available keywords from the list of keywords supplied as well as the linked short code.

Request Arguments

ArgumentTypeDescription
Keywords string required - A comma or space separated list of keywords.
A keyword can range in length from 1 to a maximum of 64 characters and letters and numbers only.

Example Request

Curl

curl -i https://www.callfire.com/api/1.1/rest/number/keyword/search?Keywords=YELLOWTAXI+ORANGEBROADSWORD \
  -H "Accept: application/xml" \
  --user <YOUR_LOGIN>:<YOUR_PASSWORD>

PHP SDK

<?php

// initialise the keywords search object
$searchKeywords = new Request\SearchAvailableKeywords();
$searchKeywords->setKeywords('YELLOWTAXI+ORANGEBROADSWORD');

// run the keywords search request
$response = $app->callfireNumberRestClient->SearchAvailableKeywords($searchKeywords);

// create a proper response object from the response payload
$result = $callfireNumberRestClient::response($response);

Node.js

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

var data  = {
    Keywords:  'RUBBISHBIN'
};
var endpoint = '?' + querystring.stringify(data);
var options = {
    host: 'www.callfire.com',
    path: '/api/1.1/rest/number/keyword/search',
    query: endpoint,
    auth: login + ':' + secret
};

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/search?",
    Login:          "24429196a2fb",
    Secret:         "f992d7d671cb5b3f",
    ReqType:        "PUT",
    RequestOptions: "Keywords=YELLOWTAXI+ORANGEBROADSWORD",
}   
client, req := callfire.InitHttpClient(requestOptions)
resp, err := client.Do(req)

Example Response

Below are two sample responses which can be received from calls to this endpoint.

Success With 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="2">
      <Keyword>
            <ShortCode>67076</ShortCode>
            <Keyword>YELLOWTAXI</Keyword>
      </Keyword>
      <Keyword>
            <ShortCode>67076</ShortCode>
            <Keyword>ORANGEBROADSWORD</Keyword>
      </Keyword>
</r:ResourceList>

Success Without 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="0"/>

 

Have more questions? Submit a request

Comments