cURL Sample – ExportTemplate.sh for Oracle Profitability and Cost Management Cloud

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

funcExportTemplate() {
	fileName=$APP_NAME+"_Template_Export_File"
	param="{\"fileName\":\"$fileName\"}"
	url=$SERVER_URL/epm/rest/$API_VERSION/applications/$APP_NAME/jobs/templateExportJob
	funcExecuteRequest "POST" $url "$param" "application/json"

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