CallFire Solutions

01. Delete a Label

Follow

01. Delete a Label

This endpoint allows for deleting an existing label registered on an account.

Endpoint

https://www.callfire.com/api/1.1/rest/label

Request Type

DELETE

Request Headers

Content-Type application/xml
Accepts application/xml

Returns

On success, the request does not return an XML payload. But it will return an HTTP 204 No Content status code, indicating that the deletion of the label was successful. If the label name specified doesn’t exist, then an XML payload is returned, indicating this, in addition to an HTTP 404 Not Found status code.

Request Arguments

 

ArgumentTypeDescription
LabelName string required. The encoded name of the label to delete.

Example Request

The below example shows how to make a delete request, to delete the label “Here is a Test Label”.

curl -i https://www.callfire.com/api/1.1/rest/label \
  -X DELETE
  -H "Accept: application/xml" \
  --user YOUR_LOGIN:YOUR_PASSWORD \
  --form "LabelName=LabelName"

PHP SDK

<?php
$query = new Request\DeleteLabel();
$query->setLabelName('Here is a Test Label');
$response = $app->callfireNumberRestClient->DeleteLabel($query);
$result = $callfireNumberRestClient::response($response);

Node.js

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

var data  = querystring.stringify({
    LabelName: "Here is a Test Label"
});
var options = {
    host: 'www.callfire.com',
    path: '/api/1.1/rest/label',
    auth: 'YOUR_LOGIN' + ':' + 'YOUR_PASSWORD',
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Content-Length': data.length
    }
};

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

// post the data
req.write(data);

req.end();

Go

requestOptions := callfire.CallFireRequestOptions{
    Url:            "https://www.callfire.com/api/1.1/rest/label?",
    Login:          "YOUR_LOGIN",
    Secret:         "YOUR_PASSWORD",
    ReqType:        "DELETE",
    RequestOptions: "LabelName=Here%20is%20a%20Test%20Label",
}
client, req := callfire.InitHttpClient(requestOptions)
resp, err := client.Do(req)

Example Response

Below is an example of an XML response payload which will be returned, if an attempt is made to delete a non-existent label.

HTTP/1.0 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>no label: Test Label</r:Message>
</r:ResourceException>
Have more questions? Submit a request

Comments