EDM Automation using Rest API

In today’s data-driven landscape, automation plays a key role in improving efficiency and reducing manual effort. In Enterprise Data Management (EDM), most actions can be automated using REST APIs—including one of the most common tasks: metadata imports.

In this blog, we’ll walk through how to automate the EDM import process step by step using REST APIs, along with practical examples using Python.


For testing and constructing API requests, I used Postman. It’s a great tool to:

  • Build REST API calls
  • Test endpoints
  • Generate request structures before implementing them in code

To execute any REST API call in EDM, you need three key components:

  1. REST URL
  2. HTTP Action (GET/POST/PATCH, etc.)
  3. Request Body

The first step is to create a request in EDM where the import will be processed.

🔹 API Details

  • REST URL
https://<instance>/epm/rest/v1/requests
  • Action
POST
  • Request Body (JSON)
{
"viewUri": "https://<instance>/epm/rest/v1/views/<view_id>",
"title": "Automated Import Request",
"description": "Request created using REST API",
"notes": ""
}

📌 The view_id remains constant for a given import view.


🔹 Sample Python Code

import requests
import json
url = "https://<instance>/epm/rest/v1/requests"
payload = json.dumps({
"viewUri": "https://<instance>/epm/rest/v1/views/<view_id>",
"title": "Automated Import Request",
"description": "Request created using REST API",
"notes": ""
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Basic <encoded_credentials>'
}
response = requests.post(url, headers=headers, data=payload)
print(response.text)

🔹 API Response

The response will include a Request ID, which is critical for the next steps:

{
"id": "948ba2aa-xxxx-xxxx-xxxx-680e5b9dc5ab",
"status": "DRAFT",
"viewName": "Import Master"
}

✅ Save this id — it will be used to upload files and submit the request.


Once the request is created, the next step is to upload the import file.

🔹 API Details

  • REST URL
https://<instance>/epm/rest/v1/requests/{request_id}/attachments/importFile
  • Action
POST
  • Request Type
form-data

🔹 Sample Python Code

import requests
url = "https://<instance>/epm/rest/v1/requests/{request_id}/attachments/importFile"
files = [
('file', ('SL_LOAD.xlsx', open('SL_LOAD.xlsx', 'rb'),
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'))
]
headers = {
'Authorization': 'Basic <encoded_credentials>'
}
response = requests.post(url, headers=headers, files=files)
print(response.text)

🔹 API Response

{
"links": [
{
"rel": "attachment",
"href": ".../attachments/<attachment_id>"
}
]
}

✅ This confirms that the file has been successfully attached to the request.

After uploading the file, the final step is to submit the request for processing.

🔹 API Details

  • REST URL
https://<instance>/epm/rest/v1/requests/{request_id}/transitions
  • Action
POST
  • Request Body
{
"action": "SUBMIT",
"comment": "This request looks good to me.",
"transitionWithWarning": false
}

🔹 Sample Python Code

import requests
import json
url = "https://<instance>/epm/rest/v1/requests/{request_id}/transitions"
payload = json.dumps({
"action": "SUBMIT",
"comment": "This request looks good to me.",
"transitionWithWarning": False
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Basic <encoded_credentials>'
}
response = requests.post(url, headers=headers, data=payload)
print(response.text)

🔹 API Response

{
"links": [
{
"rel": "results",
"href": ".../jobRuns/<job_id>"
}
]
}

🎯 This indicates that the request has been successfully submitted and is being processed.


At this point:

  • The request is created
  • The import file is uploaded
  • The request is submitted for processing

You can now verify the request status directly in EDM.


  • EDM REST APIs enable end-to-end automation of import processes
  • The workflow follows a clear sequence:
    1. Create Request
    2. Upload File
    3. Submit Request
  • Python + REST APIs provide a powerful way to integrate EDM with external systems

Automating EDM imports using REST APIs significantly reduces manual intervention and improves consistency. Once implemented, this approach can be integrated with scheduling tools or orchestration platforms like OIC, enabling fully automated data pipelines.

If you’re working extensively with EDM, mastering REST APIs is a game-changer for scalability and efficiency.

Leave a comment