How to use the JavaScript Kazoo SDK
The Kazoo javascript SDK is a jQuery plugin that allows you to easily call an extensive list of APIs from Kazoo.
This is a jQuery plugin, and therefore requires jQuery to work.
This SDK only provides a set of functions to call the APIs, you need an API server running Kazoo.
InitializationCopied
You can access the kazooSdk object by calling the method jQuery.getKazooSdk(settings)
. This object will contain all the API functions. It is strongly recommended to store this object in a variable and re-use it, instead of calling the getKazooSdk method multiple times.
The settings parameter can either be a simple string containing your API server URL, or an object containing some or all of the parameters below. Either way, the API server URL (apiRoot ) is mandatory.
Available settings :
apiRoot
: A string containing the URL to your API server.
authToken
: A Kazoo auth token previously aquired through an authentication method. This is useful if you keep the user auth token in a cookie, for example. Note: This auth token will be stored withing this kazooSdk instance the same way as if you used an auth method, meaning that you won’t need to provide it again for any API called from this instance.
onRequestStart(jqXHR, options)
: A function called right before executing the Ajax request. jqXHR
is the request object , and options
is an object containing the set of parameters provided to the request function.
onRequestEnd(data, options)
: A function called as soon as a response is received from the server. data
will be the response as a plain object in case of a success, or a jqXHR object in case of an error. options
is an object containing the set of parameters provided to the request function.
onRequestSuccess(response, options)
: A function called on every successful API call. response
is the response from the API as a plain object, and options
is an object containing the set of parameters provided to the request function.
onRequestError(error, options)
: A function called on every unsuccessful API call. error
is the response from the API as a jqXHR object, and options
is an object containing the set of parameters provided to the request function.
uiMetadata
: A json object containing the UI Metadata (such as UI version and UI name) that will be inserted in every json payloads as “ui_metadata” for non-GET APIs.
Note: The options
parameter in the onRequestStart , onRequestEnd , onRequestSuccess and onRequestError functions may be useful if you want to manually do an API call with the same parameters, using kazooSdk.request(options)
(e.g. retry after a specific error). Beware however not to get caught in an infinite loop.
Calling an API
Once you’ve properly initialized and retrieved the SDK, you can make an API call by simply running its corresponding method. Each method takes a single Javascript object as parameter which must contain at least all the mandatory settings .
Note: although it is not defined as a mandatory setting, most APIs will need an auth token. If you provided it in the settings for the getKazooSdk()
function or if you used an auth method from the SDK, the auth token will be automatically set for all your API calls.
General API settings
Note that each of these settings, if provided, will override the similar ones set with getKazooSdk()
.
apiRoot
: A string containing the URL to your API server.
authToken
: A Kazoo auth token. This will override any previously set auth token for this method only.
uiMetadata
: A json object containing the UI Metadata that will be inserted in the payload as “ui_metadata”.
acceptCharges
: A boolean that will be inserted in the payload as “accept_charges”. This will authorize the payment on transaction APIs, it is usually set after receiving a 402 error.
success(responseData)
: A function called when the API call returns successfully, where responseData
is the response payload from the API.
error(responseData, error)
: A function called when the API call returns an error, where responseData
is the JSON-parsed response payload from the API and error is the response from the API as a jqXHR object.
onChargesCancelled()
: an optional function with no parameter that will be executed when a user refuses to confirm the charges related to an action.
filters
: A map of filters to append to the API URL where the key is the URL parameter and the value is the parameter’s value. For instance, { "filter_type": "admin" }
will be translated into <your_api_url>?filter_type=admin
. See the wiki for more info about filters.
headers
: An object of additional header key/value pairs to send along with request (e.g. { 'Accept': 'application/octet-stream' }
).
cache
: A boolean specifying whether to use the cache or not for GET & HEAD requests. False by default.
You can also include custom settings that you will then handle using the options
parameter in the callbacks defined when initializing the SDK (onRequestStart
, onRequestEnd
, onRequestSuccess
, onRequestError
). You can see such a custom setting (generateError
) in the example below.
Content Type Exceptions
multipart/mixed
If the API endpoint you are working with accepts this content type, your payload need to be an array of objects, with the objects following this structure:
Key Description Type Default Required headers
List of headers of the part, key
being the header type and value
the header content Object()
false
body
Body of the part String()
true
The boundary will be handled internally by the SDK so you do not have to specify it.
Usage example
// Note that this example requires the jQuery-MD5 plugin
var kazooSdk = $. getKazooSdk ({
apiRoot : ' http://crossbarserver.yourdomain.com:8000/v2/ ' ,
uiMetadata : {
ui : ' demo-ui ' ,
version : ' 1.0 '
},
onRequestStart : function ( request , requestOptions ) {
console. log ( ' Request started ' , request);
},
onRequestEnd : function ( request , requestOptions ) {
console. log ( ' Request ended ' , request);
},
onRequestError : function ( error , requestOptions ) {
if (requestOptions.generateError !== false ) {
var parsedError = $. parseJSON (error.responseText);
alert ( ' error ' , parsedError.message);
}
}
});
kazooSdk.auth. userAuth ({
data : {
account_name : $ ( ' #account_name ' ). val (),
credentials : monster. md5 ( $ ( ' #login ' ). val () + ' : ' + $ ( ' #password ' ). val ())
},
success : function ( data , status ) {
kazooSdk.account. get ({
accountId : data.data.account_id,
success : function ( data , status ) {
console. log ( ' Account data: ' , data.data);
},
error : function ( data , status ) {
console. error ( ' Could not get the account data: ' , data);
},
generateError : false
});
}
});
List of methods
Index
Account
Method: account.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: account.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: account.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: account.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: account.listDescendants( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/descendants Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: account.listChildren( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/children Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Alert
Method: alert.list(settings )__ Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/alerts Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Auth
Method: auth.userAuth( settings ) Request Type: PUT Request URL: {apiRoot}/user_auth Request Content Type: application/json Response Content Type: json Mandatory settings : data
Optional settings : See the list of General API settings .
Method: auth.sharedAuth( settings ) Request Type: PUT Request URL: {apiRoot}/shared_auth Request Content Type: application/json Response Content Type: json Mandatory settings : data
Optional settings : See the list of General API settings .
Method: auth.pinAuth( settings ) Request Type: PUT Request URL: {apiRoot}/pin_auth Request Content Type: application/json Response Content Type: json Mandatory settings : data
Optional settings : See the list of General API settings .
Balance
Method: balance.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/transactions/current_balance Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: balance.add( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/braintree/credits Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Billing
Method: billing.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/braintree/customer Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: billing.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/braintree/customer Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Callflow
Method: callflow.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/callflows/{callflowId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, callflowId
Optional settings : See the list of General API settings .
Method: callflow.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/callflows Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: callflow.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/callflows/{callflowId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, callflowId
, data
Optional settings : See the list of General API settings .
Method: callflow.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/callflows/{callflowId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, callflowId
, data
Optional settings : See the list of General API settings .
Method: callflow.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/callflows Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Cdrs
Method: cdrs.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/cdrs/{cdrId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, cdrId
Optional settings : See the list of General API settings .
Method: cdrs.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/cdrs Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: cdrs.listByInteraction( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/cdrs/interaction Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: cdrs.listLegs( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/cdrs/legs/{callId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, callId
Optional settings : See the list of General API settings .
Channel
Method: channel.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/channels Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Conference
Method: conference.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
Optional settings : See the list of General API settings .
Method: conference.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/conferences Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: conference.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
, data
Optional settings : See the list of General API settings .
Method: conference.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
, data
Optional settings : See the list of General API settings .
Method: conference.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/conferences Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: conference.getPins( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/conferences/pins Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: conference.view( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId}/status Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
Optional settings : See the list of General API settings .
Method: conference.action( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId}/{action} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
, action
, data
Optional settings : See the list of General API settings .
Method: conference.getServer( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/conferences_servers/{serverId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, serverId
Optional settings : See the list of General API settings .
Method: conference.createServer( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/conferences_servers Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: conference.updateServer( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/conferences_servers/{serverId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, serverId
, data
Optional settings : See the list of General API settings .
Method: conference.deleteServer( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/conferences_servers/{serverId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, serverId
, data
Optional settings : See the list of General API settings .
Method: conference.listServers( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/conferences_servers Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: conference.addParticipant( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId}/add_participant Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
, data
Optional settings : See the list of General API settings .
Method: conference.muteParticipant( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId}/mute/{participantId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
, participantId
, data
Optional settings : See the list of General API settings .
Method: conference.unmuteParticipant( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId}/unmute/{participantId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
, participantId
, data
Optional settings : See the list of General API settings .
Method: conference.deafParticipant( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId}/deaf/{participantId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
, participantId
, data
Optional settings : See the list of General API settings .
Method: conference.undeafParticipant( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId}/undeaf/{participantId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
, participantId
, data
Optional settings : See the list of General API settings .
Method: conference.kickParticipant( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/conferences/{conferenceId}/kick/{participantId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, conferenceId
, participantId
, data
Optional settings : See the list of General API settings .
Method: conference.createNotification( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/notify/conference_{notificationType} Request Content Type: text/html Response Content Type: text/html Mandatory settings : accountId
, notificationType
, data
Optional settings : See the list of General API settings .
Method: conference.getNotification( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/notify/conference_{notificationType}/{contentType} Request Content Type: text/html Response Content Type: text/html Mandatory settings : accountId
, notificationType
, contentType
Optional settings : See the list of General API settings .
Method: conference.updateNotification( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/notify/conference_{notificationType} Request Content Type: text/html Response Content Type: text/html Mandatory settings : accountId
, notificationType
, data
Optional settings : See the list of General API settings .
Connectivity
Method: connectivity.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/connectivity/{connectivityId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, connectivityId
Optional settings : See the list of General API settings .
Method: connectivity.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/connectivity Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: connectivity.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/connectivity/{connectivityId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, connectivityId
, data
Optional settings : See the list of General API settings .
Method: connectivity.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/connectivity Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Device
Method: device.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/devices/{deviceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, deviceId
Optional settings : See the list of General API settings .
Method: device.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/devices Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: device.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/devices/{deviceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, deviceId
, data
Optional settings : See the list of General API settings .
Method: device.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/devices/{deviceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, deviceId
, data
Optional settings : See the list of General API settings .
Method: device.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/devices Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: device.getStatus( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/devices/status Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: device.quickcall( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/devices/{deviceId}/quickcall/{number} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, deviceId
, number
Optional settings : See the list of General API settings .
Directory
Method: directory.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/directories Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: directory.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/directories Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Global Resources
Method: globalResources.get( settings ) Request Type: GET Request URL: {apiRoot}/resources/{resourceId} Request Content Type: application/json Response Content Type: json Mandatory settings : resourceId
Optional settings : See the list of General API settings .
Method: globalResources.create( settings ) Request Type: PUT Request URL: {apiRoot}/resources Request Content Type: application/json Response Content Type: json Mandatory settings : data
Optional settings : See the list of General API settings .
Method: globalResources.update( settings ) Request Type: POST Request URL: {apiRoot}/resources/{resourceId} Request Content Type: application/json Response Content Type: json Mandatory settings : resourceId
, data
Optional settings : See the list of General API settings .
Method: globalResources.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/globalResources/{resourceId} Request Content Type: application/json Response Content Type: json Mandatory settings : resourceId
, data
Optional settings : See the list of General API settings .
Method: globalResources.list( settings ) Request Type: GET Request URL: {apiRoot}/resources Request Content Type: application/json Response Content Type: json Mandatory settings : Optional settings : See the list of General API settings .
Method: globalResources.updateCollection( settings ) Request Type: POST Request URL: {apiRoot}/resources/collection Request Content Type: application/json Response Content Type: json Mandatory settings : data
Optional settings : See the list of General API settings .
Method: globalResources.listJobs( settings ) Request Type: GET Request URL: {apiRoot}/resources/jobs Request Content Type: application/json Response Content Type: json Mandatory settings : Optional settings : See the list of General API settings .
Method: globalResources.getJob( settings ) Request Type: GET Request URL: {apiRoot}/resources/jobs/{jobId} Request Content Type: application/json Response Content Type: json Mandatory settings : jobId
Optional settings : See the list of General API settings .
Method: globalResources.createJob( settings ) Request Type: PUT Request URL: {apiRoot}/resources/jobs Request Content Type: application/json Response Content Type: json Mandatory settings : jobId
, data
Optional settings : See the list of General API settings .
Group
Method: group.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/groups/{groupId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, groupId
Optional settings : See the list of General API settings .
Method: group.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/groups Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: group.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/groups/{groupId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, groupId
, data
Optional settings : See the list of General API settings .
Method: group.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/groups/{groupId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, groupId
, data
Optional settings : See the list of General API settings .
Method: group.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/groups Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Limits
Method: limits.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/limits Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: limits.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/limits Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Local Resources
Method: localResources.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/resources/{resourceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, resourceId
Optional settings : See the list of General API settings .
Method: localResources.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/resources Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: localResources.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/resources/{resourceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, resourceId
, data
Optional settings : See the list of General API settings .
Method: localResources.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/resources/{resourceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, resourceId
, data
Optional settings : See the list of General API settings .
Method: localResources.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/resources Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: localResources.updateCollection( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/resources/collection Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: localResources.listJobs( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/resources/jobs Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: localResources.getJob( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/resources/jobs/{jobId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, jobId
Optional settings : See the list of General API settings .
Method: localResources.createJob( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/resources/jobs Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, jobId
, data
Optional settings : See the list of General API settings .
Method: media.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/medias/{mediaId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, mediaId
Optional settings : See the list of General API settings .
Method: media.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/medias Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: media.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/medias/{mediaId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, mediaId
, data
Optional settings : See the list of General API settings .
Method: media.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/medias/{mediaId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, mediaId
, data
Optional settings : See the list of General API settings .
Method: media.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/medias Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: media.upload( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/media/{mediaId}/raw Request Content Type: application/x-base64 Response Content Type: json Mandatory settings : accountId
, mediaId
, data
Optional settings : See the list of General API settings .
Method: menu.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/menus/{menuId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, menuId
Optional settings : See the list of General API settings .
Method: menu.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/menus Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: menu.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/menus/{menuId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, menuId
, data
Optional settings : See the list of General API settings .
Method: menu.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/menus/{menuId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, menuId
, data
Optional settings : See the list of General API settings .
Method: menu.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/menus Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Numbers
Method: numbers.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/phone_numbers/{phoneNumber} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, phoneNumber
Optional settings : See the list of General API settings .
Method: numbers.activate( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/phone_numbers/collection/activate Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: numbers.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/phone_numbers/{phoneNumber} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, phoneNumber
, data
Optional settings : See the list of General API settings .
Method: numbers.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/phone_numbers/collection Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: numbers.identify( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/phone_numbers/{phoneNumber}/identify Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, phoneNumber
Optional settings : See the list of General API settings .
Method: numbers.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/phone_numbers Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: numbers.listClassifiers( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/phone_numbers/classifiers Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: numbers.search( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/phone_numbers?prefix={pattern}&quantity={limit}&offset={offset} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, pattern
, limit
, offset
Optional settings : See the list of General API settings .
Method: numbers.searchBlocks( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/phone_numbers?prefix={pattern}&quantity={size}&offset={offset}&blocks={limit} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, pattern
, size
, offset
, limit
Optional settings : See the list of General API settings .
Method: numbers.searchCity( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/phone_numbers/prefix?city={city} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, city
Optional settings : See the list of General API settings .
Parked Calls
Method: parkedCalls.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/parked_calls Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Port
Method: port.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/port_requests/{portRequestId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, portRequestId
Optional settings : See the list of General API settings .
Method: port.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/port_requests Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: port.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/port_requests/{portRequestId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, portRequestId
, data
Optional settings : See the list of General API settings .
Method: port.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/port_requests/{portRequestId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, portRequestId
, data
Optional settings : See the list of General API settings .
Method: port.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/port_requests Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: port.listDescendants( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/port_requests/descendants Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: port.listAttachments( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/port_requests/{portRequestId}/attachments Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, portRequestId
Optional settings : See the list of General API settings .
Method: port.getAttachment( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/port_requests/{portRequestId}/attachments/{documentName} Request Content Type: application/pdf Response Content Type: application/pdf Mandatory settings : accountId
, portRequestId
, documentName
Optional settings : See the list of General API settings .
Method: port.createAttachment( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/port_requests/{portRequestId}/attachments?filename={documentName} Request Content Type: application/pdf Response Content Type: application/pdf Mandatory settings : accountId
, portRequestId
, documentName
, data
Optional settings : See the list of General API settings .
Method: port.updateAttachment( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/port_requests/{portRequestId}/attachments/{documentName} Request Content Type: application/pdf Response Content Type: application/pdf Mandatory settings : accountId
, portRequestId
, documentName
, data
Optional settings : See the list of General API settings .
Method: port.deleteAttachment( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/port_requests/{portRequestId}/attachments/{documentName} Request Content Type: application/pdf Response Content Type: application/pdf Mandatory settings : accountId
, portRequestId
, documentName
, data
Optional settings : See the list of General API settings .
Method: port.changeState( settings ) Request Type: PATCH Request URL: {apiRoot}/accounts/{accountId}/port_requests/{portRequestId}/{state} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, portRequestId
, state
Optional settings : See the list of General API settings .
Resource Templates
Method: resourceTemplates.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/resource_templates/{resourceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, resourceId
Optional settings : See the list of General API settings .
Method: resourceTemplates.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/resource_templates Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: resourceTemplates.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/resource_templates/{resourceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, resourceId
, data
Optional settings : See the list of General API settings .
Method: resourceTemplates.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/resource_templates/{resourceId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, resourceId
, data
Optional settings : See the list of General API settings .
Method: resourceTemplates.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/resource_templates Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Service Plan
Method: servicePlan.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/service_plans/{planId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, planId
Optional settings : See the list of General API settings .
Method: servicePlan.add( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/service_plans/{planId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, planId
, data
Optional settings : See the list of General API settings .
Method: servicePlan.remove( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/service_plans/{planId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, planId
, data
Optional settings : See the list of General API settings .
Method: servicePlan.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/service_plans Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: servicePlan.listCurrent( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/service_plans/current Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: servicePlan.reconciliate( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/service_plans/reconciliation Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: servicePlan.synchronize( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/service_plans/synchronization Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Temporal Rule
Method: temporalRule.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/temporal_rules/{ruleId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, ruleId
Optional settings : See the list of General API settings .
Method: temporalRule.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/temporal_rules Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: temporalRule.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/temporal_rules/{ruleId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, ruleId
, data
Optional settings : See the list of General API settings .
Method: temporalRule.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/temporal_rules/{ruleId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, ruleId
, data
Optional settings : See the list of General API settings .
Method: temporalRule.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/temporal_rules Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
User
Method: user.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/users/{userId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, userId
Optional settings : See the list of General API settings .
Method: user.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/users Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: user.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/users/{userId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, userId
, data
Optional settings : See the list of General API settings .
Method: user.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/users/{userId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, userId
, data
Optional settings : See the list of General API settings .
Method: user.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/users Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: user.quickcall( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/users/{userId}/quickcall/{number} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, userId
, number
Optional settings : See the list of General API settings .
Voicemail
Method: voicemail.get( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/vmboxes/{voicemailId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, voicemailId
Optional settings : See the list of General API settings .
Method: voicemail.create( settings ) Request Type: PUT Request URL: {apiRoot}/accounts/{accountId}/vmboxes Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, data
Optional settings : See the list of General API settings .
Method: voicemail.update( settings ) Request Type: POST Request URL: {apiRoot}/accounts/{accountId}/vmboxes/{voicemailId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, voicemailId
, data
Optional settings : See the list of General API settings .
Method: voicemail.patch( settings ) Request Type: PATCH Request URL: {apiRoot}/accounts/{accountId}/vmboxes/{voicemailId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, voicemailId
Optional settings : See the list of General API settings .
Method: voicemail.delete( settings ) Request Type: DELETE Request URL: {apiRoot}/accounts/{accountId}/vmboxes/{voicemailId} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, voicemailId
, data
Optional settings : See the list of General API settings .
Method: voicemail.list( settings ) Request Type: GET Request URL: {apiRoot}/accounts/{accountId}/vmboxes Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Whitelabel
Method: whitelabel.get( settings ) Request Type: GET Request URL: {apiRoot}/whitelabel/{domain} Request Content Type: application/json Response Content Type: json Mandatory settings : domain
Optional settings : See the list of General API settings .
Method: whitelabel.getLogo( settings ) Request Type: GET Request URL: {apiRoot}/whitelabel/{domain}/logo Request Content Type: application/json Response Content Type: json Mandatory settings : domain
Optional settings : See the list of General API settings .
Method: whitelabel.getDnsEntries( settings ) Request Type: GET Request URL: {apiRoot}/whitelabel/domains Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
Optional settings : See the list of General API settings .
Method: whitelabel.checkDnsEntries( settings ) Request Type: POST Request URL: {apiRoot}/whitelabel/domains?domain={domain} Request Content Type: application/json Response Content Type: json Mandatory settings : accountId
, domain
Optional settings : See the list of General API settings .