I had to take my mind off the happenings in the world for a bit, and thought what better to do, than code. It’s a terrible time for everyone, and this is just a coping mechanism for me. I hope this series does NOT become a regular feature.
As readers may know, I am a huge fan of REST APIs and I love how it adds an extra dimension to how we think about automation. Let’s look today, at a use case I’ve been playing with. One of the things that Planning (I am trying to force myself to not say EPBCS) provides is the ability to look at daily “activity reports”. These are available from Application > Activity Reports, and shows who logged in and when.
I had a use case recently where a client wanted to access these logs from a third-party tool. It is definitely possible to do this through EPM Automate using the “downloadFile” command. But, these folks did not want to use an on-premises server as a staging location. One option that is available is to use the Planning Download REST call.
From Postman, it is easy enough to look for all files that are available from Planning using the list files API call.
For instance, there’s a file call “provreport.csv” in the above screenshot that can be easily downloaded using the command below.
The activity report in question, however, is generated daily, and located in a different directory within the Planning storage structure.
Downloading files from non-root directories using REST is not as straightforward. I tried different combinations of URIs based on the documentation (which has since been fixed) including…
But no dice. I encoded the URI using urlencoder.org, but still no luck:
Finally, after a conversation with Oracle support, we arrived at the answer. Turns out that the forward slash “/” within the URI, needs to be replaced with a back slash “\”, and then encoded.
Once you add this to Postman, you get the correct results.
Remember, this will work for any file stored on the Planning directories, not just the activity report example from above. I hope this helps someone else who may be trying to solve for a similar issue.
Postman provides a URI Encoding capability if you right-click on the code you are trying to encode.
Friends, that’s all I had for today. Be safe, wash your hands, show compassion, and be positive.