CallFire Solutions

10. Disable Auto-Renew For A Number Or Keyword

Follow

This endpoint allows purchased phone numbers and keywords to be released when they’re no longer required. To put this in greater context, CallFire automatically renews your numbers and keywords each month, and bills you accordingly. When you no longer need a number or keyword, you release it to stop incurring monthly charges.

Note: Once you release a keyword or phone number, you will not be able to repurchase it for a month after the release becomes effective. For example, if your keyword is slated to auto-renew on April 29th, and you release it on April 15th, you will still be able to use it up until April 29th. However, you will not be able to repurchase it until May 29th. Therefore please be sure of your decision before releasing.

Request Type

PUT

Request Headers

Content-Type application/xml
Accepts application/xml

Returns

Requests to this endpoint, on success, don’t return an XML payload, instead they return an HTTP 204 status code.

Request Arguments

ArgumentTypeDescription
Number string required - An E.164 compliant phone number, which follows the following format:[+][country code][subscriber number including area code]. A US example phone number is: +1 (405) 509 2773.
Keyword string 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. If one or more keywords are provided, the number to which they’re linked needs to be provided.

Example Request

Here are two examples of requests to the endpoint. The first one releases only a phone number, whilst the second one releases two keywords bound to a phone number.

Releasing a Phone Number

Curl

curl -i https://www.callfire.com/api/1.1/rest/number/release \
  -X PUT \
  -F "Number=12902084590" \
  -H "Accept: application/xml" \
  --user <YOUR_LOGIN>:<YOUR_PASSWORD>

PHP SDK

<?php

$requestRelease = new Request\Release();
$requestRelease->setNumber($number);

/**
 * Will attempt to release the number.
 * If the request succeeds, $response will be a boolean. 
 * If the request fails, $response will be an \CallFire\Api\Rest\Response\ResourceException object
 */
$response = $callfireNumberClient->Release($requestRelease);

Node.js

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

var data  = { 
  Number: '12092084591'
};
var dataString = JSON.stringify(data);
var endpoint = '?' + querystring.stringify(data);
var options = { 
host: 'www.callfire.com',
      path: '/api/1.1/rest/number/release',
      query: endpoint,
      method: 'PUT',
      auth: 'YOUR_LOGIN' + ':' + 'YOUR_PASSWORD'
};

var req = https.request(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/release/",
    Login:          "YOUR_LOGIN",
    Secret:         "YOUR_PASSWORD",
    ReqType:        "PUT",
    RequestOptions: "Number=12092084590",
}
client, req := callfire.InitHttpClient(requestOptions)
resp, err := client.Do(req)

Releasing a Keyword

Curl

curl -i https://www.callfire.com/api/1.1/rest/number/release \
  -X PUT \
  -F "Number=12902084590;Keyword=SAMSUNGA5,PARISPHOTOS" \
  -H "Accept: application/xml" \
  --user <YOUR_LOGIN>:<YOUR_PASSWORD>

PHP SDK

$requestRelease = new Request\Release();
$requestRelease->setNumber($number)
               ->setKeyword('SAMSUNGA5,PARISPHOTOS');

/**
 * Will attempt to release the number.
 * If the request succeeds, $response will be a boolean. 
 * If the request fails, $response will be an \CallFire\Api\Rest\Response\ResourceException object
 */
$response = $callfireNumberClient->Release($requestRelease);

Node.js

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

var data  = { 
  Number: '12092084591',
  Keyword: 'SAMSUNGA5,PARISPHOTOS'
};
var dataString = JSON.stringify(data);
var endpoint = '?' + querystring.stringify(data);
var options = { 
host: 'www.callfire.com',
      path: '/api/1.1/rest/number/release',
      query: endpoint,
      method: 'PUT',
      auth: 'YOUR_LOGIN' + ':' + 'YOUR_PASSWORD'
};

var req = https.request(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/release/",
    Login:          "YOUR_LOGIN",
    Secret:         "YOUR_PASSWORD",
    ReqType:        "PUT",
    RequestOptions: "Number=12092084590&Keyword=SAMSUNGA5,PARISPHOTOS",
}
client, req := callfire.InitHttpClient(requestOptions)
resp, err := client.Do(req)

Example Response

Failure - Number Not Associated With Your Account

If a number is not associated with the account credentials provided, the following XML payload will be returned, with an HTTP 404 status code.

HTTP/1.1 404 Not Found
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<r:ResourceException xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource">
    <r:HttpStatus>404</r:HttpStatus>
    <r:Message>number 12092084591 does not exist, or is inactive</r:Message>
</r:ResourceException>

Failure - Keyword Does Not Exist, Is Inactive, Or Is Not Linked To Phone Number Provided

If a request is made to release a keyword which is either inactive, not associated with the account credentials provided, or not linked to the phone number provided, the following XML payload will be returned, with an HTTP 404 status code.

HTTP/1.1 404 Not Found
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<r:ResourceException xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource">
      <r:HttpStatus>404</r:HttpStatus>
      <r:Message>number <NUMBER_PROVIDED> with keyword <KEYWORD_PROVIDED> does not exist, or is inactive</r:Message>
</r:ResourceException>

 

Have more questions? Submit a request

Comments