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

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

funcGeneratePrgDocReport() {
        url=$SERVER_URL/epm/rest/$API_VERSION/applications/$APP_NAME/povs/$POV_GROUP_MEMBER1/programDocumentationReport
        echo $url
        curl -G "$url" --data-urlencode 'queryParameter={"fileType":"PDF","stringDelimter":"_","useAlias":"false"}' -u "$USERNAME:$PASSWORD" -o "response.txt" -D "respHeader.txt"
        output=`cat response.txt`
        status=`echo $output | jq '.status'`
        echo $status
    if [ $status == 0 ]; then
        echo "Program Documentation Report generated successfully"
        message=`echo $output | jq '.details'`
        echo $message
    else
        error=`echo $output | jq '.details'`
        echo "Error occurred. " $error
    fi
    funcRemoveTempFiles "respHeader.txt" "response.txt"

}