---
schema_version: "1"
id: b382a71a785652068b7716faa781767e20b7578e434e3a94678a63dad0fd7890
title: getLocationUrl()
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_canvas_EnvironmentContext_getLocationUrl.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_getLocationUrl.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 62d0dbe0ae007c8eb32747727ae52f8e107ceb4fc6701edf1ed9fe26c8a2a022
description: Retrieves the location URL of the canvas app.
---
# getLocationUrl()

Retrieves the location URL of the canvas app.

## Signature

public String getLocationUrl()

## Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

## Usage

Use this method to obtain the URL of the page where the user accessed the canvas app. For example, if the user accessed your app by clicking a link on the Chatter tab, this method returns the URL of the Chatter tab, which would be similar to ‘https://MyDomainName.my.salesforce.com/\_ui/core/chatter/ui/ChatterPage’.