---
schema_version: "1"
id: b69da49b8a4feb1c5e3bd6c0d081a37394cbfb7cf606d194efb1aa0d31a80478
title: setSoftphoneItemIcon() for Lightning Experience
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-setsoftphoneitemicon-lex.md
canonical_url: https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-setsoftphoneitemicon-lex.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a424dc1b6cb424f519859692860e1b9546b26974ebbdfa0f29971e13619b8f6f
products:
  - Open CTI Developer Guide
  - Service Cloud Developer Content
---

# setSoftphoneItemIcon() for Lightning Experience

## Usage

Sets the icon for the softphone item in the utility bar. Returns `true` if the function is successfully executed, and `false` when there is a failure. This method is available in API version 38.0 or later.

The softphone icon in the utility bar.

![Screen shot of softphone in utility bar.](https://developer.salesforce.com/docs/media/softphone_item_icon_lex.png)

## Syntax

```javascript
sforce.opencti.setSoftphoneItemIcon({
     key:KEY, 
     callback:FUNCTION  //Optional
});
```

## Arguments

|Name|Type|Description|
|------|------|-------------|
|`key`|string|The key corresponding to the icon in the Lightning Design System you want to use for the softphone icon in the utility bar.|
|`callback`|function|JavaScript method executed when the API method call is completed.|


## Sample Code–HTML and JavaScript

<!-- html set_clipboard -->
```html
<html> 
<head>
    <script type="text/javascript" src="https://domain:port/support/api//lightning/opencti_min.js"></script>
    <script type="text/javascript">
      var callback = function(response) {
         if (response.success) {
            console.log('API method call executed successfully! returnValue:', response.returnValue);
         } else { 
            console.error('Something went wrong! Errors:', response.errors);
         }
      };

      function setSoftphoneItemIcon() {
          sforce.opencti.setSoftphoneItemIcon({key:"call", callback: callback});
      }
     </script>
  </head>
  <body>
    <button onclick="setSoftphoneItemIcon();">setSoftphoneItemIcon()</button>
  </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|
|------|------|-------------|
|`success`|boolean|Returns `true` if the API method call was invoked successfully, `false` otherwise.|
|`returnValue`|object|This API method doesn’t return this object. The `returnValue` is always `null`.|
|`errors`|array|If the API call was successful, this variable is `null`. If the API call failed, this variable returns an array of [error messages](https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-error-messages-lightning.md).|


