Essbase Data Load for Profitability and Cost Management

Loads input data to an Oracle Essbase application.

Required Roles

Service Administrator, Power User

REST Resource

POST /epm/rest/{api_version}/applications/{application}/jobs/essbaseDataLoadJob

Note:

Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for EPM Cloud REST APIs. Using this REST API requires prerequisites. See Prerequisites.

Request

Supported Media Types: application/json

The following table summarizes the client request.

Table 24-15 Parameters

Name Description Type Required Default
api_version Version of the API you are developing with Path Yes None
application Name of the application for which to load the data Path Yes None
clearAllDataFlag Whether to clear existing data (true) or not (false) Payload Yes None
dataLoadValue Possible values are ADD_EXISTING_VALUES or OVERWRITE_EXISTING_VALUES Payload Yes None
dataFileName Name of the data file already present in the inbox folder Payload Yes None

Example URL and Payload

https://<BASE-URL>/epm/rest/v1/applications/BksML12/jobs/essbaseDataLoadJob

{"clearAllDataFlag":"true","dataLoadValue":"OVERWRITE_EXISTING_VALUES","dataFileName":"input.txt"}

Response

Supported Media Types: application/json

Table 24-16 Parameters

Name Description
details Task ID, such as BksML12_BksML12_LoadData_D20160118T051020_ba8_1
status See Migration Status Codes
statusMessage Message about the status, such as Success
type Profitability
data Parameters as key value pairs
links Detailed information about the link
href Links to API call
action The HTTP call type
rel Relationship type
data Parameters as key value pairs passed in the request

Example of Response Body

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

{
   "type":"Profitability",
   "status":-1,
   "statusMessage":"In Progress",
   "details":"BksML30_LoadData_D20220511T114654_8bf",
   "links":[
      {
         "href":"http://<BASE-URL>/epm/rest/v1/applications/jobs/ChecktaskStatusJob/BksML30_LoadData_D20220511T114654_8bf",
         "action":"GET",
         "rel":"Job Status"
      }
   ]
}

Java Sample – EssbaseDataLoad.java for Profitability and Cost Management

Prerequisites: json.jar

Common Functions: See Profitability and Cost Management Common Helper Functions for Java

    public void loadData() throws Exception {
        
        JSONObject json = new JSONObject();
        json.put("clearAllDataFlag", false);
        json.put("dataLoadValue", "ADD_EXISTING_VALUES");
        json.put("dataFileName", "BksML12C.txt");
        
        String urlString = "%s/epm/rest/%s/applications/%s/jobs/essbaseDataLoadJob";
        executeJob(urlString, "POST", json.toString());
        
    }

cURL Sample – EssbaseDataLoad.sh for Profitability and Cost Management

Common Functions: See Profitability and Cost Management Common Helper Functions for cURL.

funcLoadData() {
	dataLoadValue="ADD_EXISTING_VALUES"
	dataFileName="BksML12C.txt"
	param="{\"clearAllDataFlag\":\"false\",\"dataLoadValue\":\"$dataLoadValue\",\"dataFileName\":\"$dataFileName\"}"
	url=$SERVER_URL/epm/rest/$API_VERSION/applications/$APP_NAME/jobs/essbaseDataLoadJob
	funcExecuteRequest "POST" $url "$param" "application/json"

	output=`cat response.txt`
	status=`echo $output | jq '.status'`
    if [ $status == -1 ]; then
        echo "Started Loading Data successfully"
		funcGetStatus "GET"
    else
        error=`echo $output | jq '.details'`
        echo "Error occurred. " $error
    fi
	funcRemoveTempFiles "respHeader.txt" "response.txt"
}

Groovy Sample – EssbaseDataLoad.groovy for Profitability and Cost Management

Prerequisites: json.jar

Common Functions: See Appendix C: Common Helper Functions for Groovy.

def loadData() {
        
        JSONObject json = new JSONObject();
        json.put("clearAllDataFlag", false);
        json.put("dataLoadValue", "ADD_EXISTING_VALUES");
        json.put("dataFileName", "BksML12C.txt");
        
        def url;
        def response;
	
        try {
                 url = new URL(serverUrl + "/epm/rest/" + apiVersion + "/applications/" + appName + "/jobs/essbaseDataLoadJob")
        } catch (MalformedURLException e) {
                 println "Malformed URL. Please pass valid URL"
                 System.exit(0);
        }         
        executeJob(url, "POST", json.toString());        
}