Document REST New Content and Properties JSON payload

Hi,

I am trying to create a document with content and metadata in the Document REST using Angular JS

I am getting some below error. Please let me know what is that i am missing.

POST /dctm-rest/repositories/demo/folders/0b01e24080008993/documents?content-count=1&primary=true&format=text HTTP/1.1

host: localhost:8080
connection: keep-alive
content-length: 312
accept: application/vnd.emc.documentum+json
postman-token: f4df00fb-fe61-d8d0-6566-1b61f7fec00f
cache-control: no-cache
origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
authorization: Basic QWRtaW5pc3RyYXRvcjpQYXNzd29yZEAxMjM=
content-type: multipart/form-data;boundary=vFKDeJ2jOu0ZQqKu9BGfHj9otiMJq44EwXfiV
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9

------WebKitFormBoundaryDscW0nzPIr6uhBJs
Content-Disposition: form-data; name="object"

{"properties":{"r_object_type": "dm_document", "object_name":
"readme.txt"}}
------WebKitFormBoundaryDscW0nzPIr6uhBJs
Content-Disposition: form-data; name="content"

hello
------WebKitFormBoundaryDscW0nzPIr6uhBJs--
???

2019-01-09 14:25:32,913 6265101 [http-nio-8080-exec-8] DEBUG com.emc.documentum.rest.log.MessageLoggingFilter - The response message dump:

  • Outbound Response 65dc09b2-730d-4057-83f4-9b4d5ce588c7
    < Status: 400
    < Access-Control-Allow-Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
    < Vary: Origin
    < Access-Control-Expose-Headers: Location, DOCUMENTUM-CSRF-TOKEN
    < Access-Control-Allow-Credentials: true
    < Status Code: 400
    < Content-Type: application/vnd.emc.documentum+json;charset=UTF-8
    < X-Content-Type-Options: nosniff
    < X-XSS-Protection: 1; mode=block
    < Cache-Control: no-cache, no-store, max-age=0, must-revalidate
    < Pragma: no-cache
    < Expires: 0
    < X-Frame-Options: DENY

{"status":400,"code":"E_INPUT_MESSAGE_NOT_READABLE","message":"The input message is not readable.","details":"Required request body is missing: public com.emc.documentum.rest.model.DocumentObject com.emc.documentum.rest.controller.FolderChildDocumentsController.createChildDocument(java.lang.String,com.emc.documentum.rest.model.DocumentObject,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,boolean,com.emc.documentum.rest.http.UriInfo) throws com.documentum.fc.common.DfException,org.springframework.web.bind.MissingServletRequestParameterException","id":"7f30f2de-a94b-4318-b11d-217b76fc83fc"}

Vinod Krishna
Architect, Consulting Services
OpenText

Comments

  • Content-Disposition: form-data; name="object" should be instead:
    Content-Disposition: form-data; name="metadata"

    and
    Content-Disposition: form-data; name="content" should be instead:
    Content-Disposition: form-data; name="binary"

  • hi Hicham

    I modified that but still the same error. Can you please JSON payload sample if you have for uploading Content and Metadata,

    Thanks

    Vinod Krishna
    Architect, Consulting Services
    OpenText

  • Did anyone able to fix this? Am getting the same error while uploading a sample document through postman.

  • I am also getting same error. If it has fixed then please provide details

  • are you using the Angular Code to connect to REST services?

    Vinod Krishna
    Architect, Consulting Services
    OpenText

  • In Angular 5, I used httpClient rather than http which resolved this issue.

    Vinod Krishna
    Architect, Consulting Services
    OpenText