Class: Number

Retreaver. Number

new Number(attributes)

Parameters:
Name Type Description
attributes Object Attributes
Properties:
Name Type Description
attributes Object
Properties
Name Type Description
id Number The CallPixels internal number ID.
formatted_number String Nationally formatted phone number.
number String E.164 formatted phone number.
extension String The extension number.
plain_number String The unformatted phone number digits.
number_extension String The phone number digits with extension.
target_open Boolean Whether there is an open, available target.
Source:

Methods

add_tags(tags, callback)

Add tags to a number.
Parameters:
Name Type Description
tags Object A collection of tags {key: 'value', tag2: 'value2'}
callback function Callback that will be fired after request.
Source:
Throws:
Will throw an error if attempting to modify tags on a number that doesn't belong to a number pool with per-visitor numbers enabled.

clear_tags(callback)

Clear all tags from a number.
Parameters:
Name Type Description
callback function Callback that will be fired after request.
Source:
Throws:
Will throw an error if attempting to modify tags on a number that doesn't belong to a number pool with per-visitor numbers enabled.

initiate_call(dial, payload, callback)

Start a call immediately by having a campaign target dial the visitor.
Parameters:
Name Type Description
dial String The number to call.
payload Object A collection of tags as key-value pairs and optional secure override properties.
Properties
Name Type Argument Description
target_map string <optional>
A string mapping a placeholder number to a phone number.
target_map_cs string <optional>
A SHA1 checksum of the target_map concatenated with your CallPixels API key.
timer_offset number <optional>
Number of seconds to offset the "connect" duration timers by.
timer_offset_cs string <optional>
An SHA1 checksum of the timer_offset concatenated with your CallPixels API key.
* string | number <optional>
Key value pairs treated as tags.
callback function Callback that will be fired after request.
Source:
Example
number.initiate_call('4166686980', {company_name: 'CallPixels'}, function (call) {
    alert('Call started with UUID ' + call.uuid)
});

release()

Release number back to pool.
Source:

remove_tags(tags, callback)

Remove tags from a number.
Parameters:
Name Type Description
tags Object A collection of tags {key: 'value', tag2: 'value2'}
callback function Callback that will be fired after request.
Source:
Throws:
Will throw an error if attempting to modify tags on a number that doesn't belong to a number pool with per-visitor numbers enabled.

remove_tags_by_keys(keys, callback)

Removes all tags with given keys from a number.
Parameters:
Name Type Description
keys Array An array of keys to remove. eg: ['key1', 'key2']
callback function Callback that will be fired after request.
Source:
Throws:
Will throw an error if attempting to modify tags on a number that doesn't belong to a number pool with per-visitor numbers enabled.