---
schema_version: "1"
id: cc9fd9ea75f0992da02c6d493a6fae13d931a260065b558e1cfe4a24fbf79019
title: setSoftphoneHeight() for Salesforce Classic
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/api-cti/guides/sforce-api-cti-setsoftphoneheight.md
canonical_url: https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-setsoftphoneheight.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7a278d25526a3efc4dbdfe1d268400609c2b3e840f22aea516bee18354ef2d22
products:
  - Open CTI Developer Guide
  - Service Cloud Developer Content
---

# setSoftphoneHeight() for Salesforce Classic

## Usage

Sets the softphone height in pixels.

**note:** If this method is used in a Salesforce console where multi-monitor components is turned on, an error will be returned because resizing multi-monitor component is not allowed.

## Syntax

```javascript
sforce.interaction.cti.setSoftphoneHeight(height:number, (optional) callback:function)
```

## Arguments

|Name|Type|Description|
|------|------|-------------|
|`height`|number|Softphone height in pixels. The height should be a number that’s equal or greater than 0.|
|`callback`|function|JavaScript method executed when the API method call is completed.|


## Sample Code–JavaScript

<!-- javascript set_clipboard -->
```javascript
<html>
<head>
   <script type="text/javascript" src="http://domain:port/support/api/25.0/interaction.js"></script>
   <script type="text/javascript">
       var callback = function (response) {
           if (response.result) {
              alert('Height was set successfully.');
           }
           else {
              alert('Height was not set successfully.');
           }
        };
</script>
</head>
<body>
       <button onclick="sforce.interaction.cti.setSoftphoneHeight(200, callback);">
       set softphone height to 200px
       </button>
</body>
</html>
```

## Response

|Name|Type|Description|
|------|------|-------------|
|`result`|boolean|`true` if the height was set successfully, `false` if setting the height wasn’t successful.|
|`error`|string|If the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message.|


