Delete Files

Deletes a file from the Oracle Planning and Budgeting Cloud repository. SeeAbout the EPM Automate Utility.

REST Resource

DELETE /interop/rest/{api_version}/applicationsnapshots/{applicationSnapshotName


Supported Media Types: application/json


The following table summarizes the request parameters.

Table 6-13 Parameters

Name Description Type Required Default
api_version Specific API version Path Yes None
applicationSnapshotName Application snapshot name that needs to be deleted Path Yes None


Supported Media Types: application/json

Table 6-14 Parameters

Parameters Description
Details Published if there is an error with the error string
Status See Migration Status Codes
Links Detailed information about the link
Href Links to the API call
Action The HTTP call type
Rel Possible value: self
Data Parameters as key value pair passed in the request

Example of Response Body


Delete Files Sample Code

Example 6-16 Java Sample –

Prerequisites: Java-JSON.jar

Common Functions: See Common Helper Functions for Java

// BEGIN - Delete a file in PBCS
public void deleteFile(String fileName) throws Exception {
        String urlString = String.format("%s/interop/rest/%s/applicationsnapshots/%s", serverUrl, apiVersion, fileName);
        String response = executeRequest(urlString, "DELETE", null);
        JSONObject json = new JSONObject(response);
        int resStatus = json.getInt("status");
        if (resStatus == 0)
                System.out.println("File deleted successfully");
                System.out.println("Error deleting file : " + json.getString("details"));
// END - Delete a file in PBCS

Example 6-17 cURL Sample –

Prerequisites: jq (

Common Functions: See Common Helper Functions for cURL

funcDeleteFile() {
        encodedFileName=$(echo $1 | sed -f urlencode.sed)
        funcExecuteRequest "DELETE" $url

        output=`cat response.txt`
        status=`echo $output | jq '.status'`
    if [ $status == 0 ]; then
        echo "Deleted successfully"
        error=`echo $output | jq '.details'`
        echo "Error occurred. " $error
        funcRemoveTempFiles "respHeader.txt" "response.txt"

Example 6-18 Groovy Sample – DeleteFile.groovy

Prerequisites: Java-JSON.jar

Common Functions: Common Helper Functions for Groovy

def deleteFile(filename) {
        def url;
        try {
                String encodedFileName = URLEncoder.encode(filename, "UTF-8");
                url = new URL(serverUrl + "/interop/rest/" + apiVersion + "/applicationsnapshots/" + encodedFileName)
        } catch (MalformedURLException e) {
                println "Malformed URL. Please pass valid URL"
        response = executeRequest(url, "DELETE", null);
        def object = new JsonSlurper().parseText(response)
        def status = object.status
        if (status == 0 )
                println "File deleted successfully"
        else {
                println "Error occurred while deleting file"
                if (object.details != null)
                        println "Error details: " + object.details