List Files

Lists the files in the Planning repository and returns information about the available file and application snapshots. It provides details such as name, type, size and last modified time. Size and last modified are not available for LCM snapshots. See About the EPM Automate Utility. This REST API is version

Required Roles

Service Administrator

REST Resource

GET /interop/rest/{api_version}/applicationsnapshots

Supported Media Types: application/json


Table 7-11 Parameters

Name Description
Details Will be published in case of error with the error string
Status See Migration Status Codes
Name Name of the application snapshot


Type signifies if this snapshot is for LCM or EXTERNAL. LCM indicates that the file is an LCM snapshot. EXTERNAL indicates that files are not LCM, such as Planning files.

Size Size of the application snapshot in bytes. Available only for type EXTERNAL
Lastmodifiedtime Time in Long value as per the last modified time of the file. Available only for type EXTERNAL
Links Detailed information about the link
Href Link to API call/ status API
Action The HTTP call type
Rel Will be self
Data Parameters as key value pairs passed in the request

Example of Request Body

The following shows an example of the response body in JSON format.


List Files Sample Code

Example 7-11 Java Sample –

Prerequisites: json.jar

Common Functions: See Common Helper Functions for Java

// BEGIN - List all the files in PBCS
public void listFiles() throws Exception {
	String urlString = String.format("%s/interop/rest/%s/applicationsnapshots", serverUrl, apiVersion);
	String response = executeRequest(urlString, "GET", null);
	JSONObject json = new JSONObject(response);
	int resStatus = json.getInt("status");
	if (resStatus == 0) {
		if (json.get("items").equals(JSONObject.NULL))
			System.out.println("No files found");
		else {
			System.out.println("List of files :");
			JSONArray itemsArray = json.getJSONArray("items");			
			JSONObject jObj = null;
			for (int i=0; i < itemsArray.length(); i++){
				jObj = (JSONObject)itemsArray.get(i);
// END - List all the files in PBCS

Example 7-12 cURL Sample–

funcListFiles() {
	funcExecuteRequest "GET" $url

	list=`cat response.txt | jq 'select(.items != null) | .items[].name'`
	if [[ ! -z $list ]]; then
		echo $list
		echo "No files found"
	funcRemoveTempFiles "respHeader.txt" "response.txt"

Prerequisites: jq (

Common Functions: See Common Helper Functions for cURL

Example 7-13 Groovy Sample– ListFiles.groovy

def listFiles() {
	def url;
	try {
			url = new URL(serverUrl + "/interop/rest/" + apiVersion + "/applicationsnapshots")
	} catch (MalformedURLException e) {
			println "Malformed URL. Please pass valid URL"
	response = executeRequest(url, "GET", null);
	def object = new JsonSlurper().parseText(response)
	def status = object.status
	if (status == 0 ) {
		def items = object.items
		if (items == null) {
			println "No files found"
		else {
			println "List of files :"
	} else {
		println "Error occurred while listing files"
		if (object.details != null)
				println "Error details: " + object.details

Prerequisites: json.jar

Common Functions