As you may already know, I love using Python to work with Oracle Cloud EPM REST APIs. Today I wanted to share the code snippet that can be used to search for a file in EPM. Under the hood is the “List Files” REST API. You can read more about the API here.
Here is the code snippet for the function. The function has one input, which is the file name to be searched for in EPM.
epmUrl is the url of the EPM instance. On Line 6, I am constructing the listFile API end point. The API version is 220.127.116.11.600. One Line 7, I invoke the REST API. Make sure to provide the correct user and password.
If you are on OCI Gen 1, the user name should be “identity domain.username”. If you are on OCIG Gen 2, you dont need to prefix the identity domain with the username.
Now you can search the file by invoking the function like below
The fileDetails object has the following information
You are gonna need the following packages 📦 for the code to work.
I will adding more helpful python code snippets. Follow me for more code snippets related to Oracle EPM REST APIs. You can improve this code by using try, except, finally block in the function.