getSoftphoneLayout() for Salesforce Classic
Usage
Returns the softphone layout as a JSON string. This method is only available in API version 27.0 or later.
Syntax
sforce.interaction.cti.getSoftphoneLayout(callback:function);
Arguments
Name | Type | Description |
---|---|---|
callback | function | JavaScript method executed when the API method call is completed. |
Sample Code–JavaScript
<html>
<head>
<script type="text/javascript" src="http://domain:port/support/api/27.0/interaction.js"></script>
<script type="text/javascript">
var callback = function (response) {
alert(response.result);
}
// Calls getSoftphoneLayout
sforce.interaction.cti.getSoftphoneLayout(callback);
</script>
</head>
<body></body>
</html>
Response
This method is asynchronous. The response is returned in an object passed to a callback method. The response object contains the following fields.
Name | Type | Description |
---|---|---|
result | string | If the API call was successful, the softphone layout definition is returned as a JSON
string. If the API call failed, null is returned. The returned JSON string contains three elements that represent each of the call types:
Each call-type contains three subsections:
The following is an example of a JSON response:
|
error | string or undefined | If the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message. |