CallFire Solutions

04. Unlabel Broadcast

Follow

This endpoint allows for removing a label from a broadcast. Labels can be removed from both running and non-running broadcasts alike. There is no requirement for one to be running. To add a label to a broadcast, see the LabelBroadcast endpoint.

Note: There is, currently, no way of seeing, directly, which labels are attached to which broadcasts.

Endpoint

https://www.callfire.com/api/1.1/rest/label/broadcast/{id}

Request Type

DELETE

Request Headers

Content-Type application/xml
Accepts application/xml

Returns

On success, requests to this endpoint do not return an XML response payload, but do return an HTTP 204 No Content status code.

Request Arguments

ArgumentTypeDescription
Id long required - Default: 1000. The maximum number of results to return.
LabelName string required. The encoded name of the label to add to the broadcast.

Curl

curl -i https://www.callfire.com/api/1.1/rest/label/broadcast/5351628003/?LabelName=Here-Is-My-Label \
  -H "Accept: application/xml" \
  -X DELETE \
  --user <YOUR_LOGIN>:<YOUR_PASSWORD>

PHP SDK

<?php

$broadcastId = '5351697003';
$query = new Request\UnlabelBroadcast();
$query->setLabelName('Here Is My Label');
/** @var \CallFire\Api\Rest\Client\Label $label */
$response = $app->callfireNumberRestClient->UnlabelBroadcast($broadcastId, $query);
/** @var \CallFire\Common\Resource\Label[] $result */
$result = $callfireNumberRestClient::response($response);

if ($result instanceof \CallFire\Api\Rest\Response\ResourceException) {
    $succeeded = false;
} else {
    $succeeded = true;
}

Node.js

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

var host = 'www.callfire.com';
var path = '/api/1.1/rest/label/broadcast/5351628003';
var login = 'YOUR_LOGIN';
var secret = 'YOUR_SECRET';
var data  = {
    'LabelName': 'Here Is My Label'
};
var options = {
    host: host,
    path: path,
    auth: login + ':' + secret,
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Content-Length': data.length
    }
};

var req = https.get(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/broadcast/5351628003/?",
    Login:          "YOUR_LOGIN",
    Secret:         "YOUR_PASSWORD",
    ReqType:        "DELETE",
    RequestOptions: "LabelName=Here+Is+My+Label",
}
client, req := callfire.InitHttpClient(requestOptions)
resp, err := client.Do(req)

Example Response

If the request is successful, no XML response payload will be returned, but an HTTP 204 No Content status code will be.

Malformed Request

If either the request is malformed the response below will be returned

HTTP/1.1 500
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>500</r:HttpStatus>
    <r:Message>Internal Server Error</r:Message>
</r:ResourceException>

Have more questions? Submit a request

Comments