How to upload a file from local system using Post Man DCTM Rest API

Srihari Reddy S
edited October 9 in Documentum #1

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

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.
    • 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.

    Thanks, Kaushal