---
schema_version: "1"
id: b3d71266669273edfb70752760183e3425e4233103a8a0eb520c1db5e6f171c4
title: getSoftphoneLayout() 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-getsoftphonelayout.md
canonical_url: https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-getsoftphonelayout.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c3797bf49d21d029ff55d1729c76342fd753aa50f2c2053e18c1d17afeed7a37
products:
  - Open CTI Developer Guide
  - Service Cloud Developer Content
---

# 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

```javascript
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

<!-- javascript set_clipboard -->
```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.|
|`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.|


The returned JSON string contains three elements, one for each call type:


-   `"Internal"`
-   `"Inbound"`
-   `"Outbound"`

Each call type contains three subsections:


-   `"callRelatedFields"`—An array of call-related fields selected to display. Possible values are `"ANI"`, `"DNIS"`, `"SEGMENT"`, and `"QUEUE"`.
-   `"objects"`—The set of Salesforce objects selected to display, along with the `Field Label` and `Field Name` (API name) selected to display from each object.
-   `"screenPopSettings"`—Contains a `"screenPopsOpenWithin"` field with a value of either `"ExistingWindow"` or `"NewWindow"`, and settings for each screen pop match type: `"NoMatch"`, `"SingleMatch"`, and `"MultipleMatches"`. Each match type contains a `"screenPopType"` field and may also contain a `"screenPopData"` field. If `"screenPopType"` is `"PopToEntity"`, then `"screenPopData"` contains the target object name. If it is `"PopToVisualforce"`, then `"screenPopData"` contains the target Visualforce page name. If it is `"PopToSearch"`, there is no `"screenPopData"` field.

Example `result`:

```javascript
"Internal" : {
   "callRelatedFields" : [
    "ANI",  
    "DNIS", 
   ]
   "objects" : {
    "User" : [ {
      "displayName" : "Name",
      "apiName" : "Name"
     }
    ]
   },
   "screenPopSettings" : {}
  },
  "Inbound" : {
   "callRelatedFields" : [
    "ANI",
    "DNIS",
    "SEGMENT",
    "QUEUE"  
   ],
    "objects" : {
    "Account" : [ {
      "displayName" : "Account Name",
      "apiName" : "Name"
     }
    ]
     
   },
   "screenPopSettings" : {
    "NoMatch" : {
     "screenPopType" : "PopToEntity",
     "screenPopData" : "Contact"  
    },
     
    "SingleMatch" : {
     "screenPopType" : "PopToVisualforce",
     "screenPopData" : "Visualforce_Page_Name"
    },
    "MultipleMatches" : {
     "screenPopType" : "PopToSearch"
    }
   }
  },
  "Outbound" : {
   "callRelatedFields" : [
    "DNIS"  
   ],
   "objects" : {
    "Account" : [ {
      "displayName" : "Account Name",
      "apiName" : "Name"
     }
    ]
   },
   "screenPopSettings" : {}
  }
 }
```

