Today, let’s continue exploring REST requests related to EDM. Have a read of part 1 here. We are now going to look at the next steps that we need to follow to complete our request process.
Upload a File
EDM in its current form requires an Excel spreadsheet, to be used for requests. This makes automation a bit difficult, in my opinion. I hope Oracle is thinking about a more efficient file-based request process (like .csv or .txt) in addition to Excel. This way, Excel could be used for business users performing requests, and other formats could be used for automations and integrations. Maybe I am just missing an obvious trick, and non-Excel options are indeed available. Post a comment if this is the case so that everyone can learn.
Nonetheless, Excel it is, and the is what the Excel file needs to look like.
- At minimum, we need the highlighted values included in the file.
- The file needs to be a “.xlsx” file.
- The tab name needs to be the same as the viewpoint name.
A great post on allowed “Action Codes” from Kate Helmer can be found here.
The REST API documentation for uploading the file can be found here. Part of the reason why I wanted to do this post, was that the REST call is a little bit tricky to decipher from Postman.
The required elements for this call are:
- Content-Type header: this has to be set as “multipart/form-data”. The “boundary” can be set to whatever.
- File: path and name of the file being loaded.
- FileName: name of the file being loaded.
While the documentation mentions that bullet 2 is optional, I found that I had to add it to Postman to get it working. Here is my setup (note that the request ID generated earlier is needed here):
NOTE: We need the request ID generated in the previous step to complete the POST action for file upload process.
Once we run the request, we get a “URI” which needs to be collected and saved for the next step in the process. This is the so-called “attachment URI”.
Generate Request Items
This step loads the records within the attachment, into EDM in a draft state. This too, is a POST action, with documentation found here. The 2 elements needed for this action are the request ID, the sheet name of the spreadsheet you are trying to load, and the attachment URI.
Once this is run successfully, you can see the 2 nodes added to the hierarchy in an uncommitted state.
Commit the Request
The last step to perform is to commit the nodes to EDM. There may be other steps based on your workflow, but, in most cases, “promoting” the nodes should result in committing the nodes to memory. This is another “POST” action, for which you will need the request ID. The documentation for this transition stage, can be found here.
If you check on EDM, you can see that the request has been completed.
This brings our series on creating requests and looking towards automating EDM maintenance using the REST API to an end. I am sure EPM-Automate will catch up soon, and provide these capabilities.
The calls I used were:
POST import file
POST import items from file
POST commit action