How to upload a file from local system using Post Man DCTM Rest API
Srihari Reddy S
Member
Hi,
I have a requirement where I need to upload a file from local system using DCTM Rest API. I have achieved this by adding the file directly in the postman, but is there a way to specific the path of the file location in JSON and upload the document from the path to the repository?
The file should be picked from the specified file path. I am using Postman.
PostMan version: 11.15
DCTM Version: 20.2
Thanks,
Srihari Reddy
0
Answers
-
Hi @Srihari Reddy S,
You can use the below endpoint with
POST
http method :http://localhost:8080/dctm-rest/repositories/REPO/folders/<folder-id>/documents
Set Up the Body: In the Body tab, use form-data to send the metadata and file content.
- Add the Metadata:
- In the first field (key), type
metadata
. - Choose a text as the type
- Copy Below JSON body and put it in value field
{
"properties":
{
"object_name": "Documentum on Kubernetes",
"r_object_type": "dm_document"
}
}
- Align it properly.
- In the first field (key), type
- Add the File:
- In the second field (key), type
content
. - Choose File as the type.
- Select the file (using file picker) you want to upload from your local machine -
"C:\Users\Lenovo\Downloads\Documentum on Kubernetes.pdf"
- This corresponds to the file that you are sending as content.
- In the second field (key), type
Thanks, Kaushal
0 - Add the Metadata:
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 150 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories