---
schema_version: "1"
id: 3278ccca5591b09d429f9ed2355565bad6879dc50dbd750cbf70135cffc61827
title: getPageInfo() 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-getpageinfo.md
canonical_url: https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-getpageinfo.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d2c48aa16eafa02e313072a175a755195132f9d91043c71748418ba51ba3a788
products:
  - Open CTI Developer Guide
  - Service Cloud Developer Content
---

# getPageInfo() for Salesforce Classic

## Usage

Returns information about the current page.

## Syntax

```javascript
sforce.interaction.getPageInfo(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/25.0/interaction.js"></script>
   <script type="text/javascript">
       var callback = function (response) {
           if (response.result) {
                  alert(response.result);
            } else {
                   alert(response.error);
           }
        };
       function getPageInfo() {
                //Invokes API method
                sforce.interaction.getPageInfo(callback);
        }
</script>
</head>
<body>
       <button onclick="getPageInfo();">getPageInfo</button>
</body>
</html>
```

## Response

|Name|Type|Description|
|------|------|-------------|
|`result`|string|Returns the URL of the current page as a JSON string, including any applicable object ID, object name, object type, and for API version 33.0 or later, the object tab name. For API version 31.0 and later, invoking this method on a PersonAccount object also returns `accountId` or `contactId`, and `personAccount` (`true` if the object is a PersonAccount, `false` otherwise).|
|`error`|string|If the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message.|


Example `result`:

```javascript
{"url":"https://MYDOMAINNAME.my.salesforce.com/001x0000003DGQR",
"objectId":"001x0000003DGQR","objectName":"Acme",
"object":"Account","displayName":"Company"}
```

Example `result` for a PersonAccount object (API version 31.0 and later):

```javascript
{"url":"https://MYDOMAINNAME.my.salesforce.com/001x0000003DGQR",
"objectId":"001x0000003DGQR","objectName":"Acme Person Account",
"object":"Account", "contactId":"003D000000QOMqg", "personAccount":true}
```

