Can't create a Document via Rest API

Hello,

we are using the POST API /v2/nodes to create a Document on our Content Server. The body of our request is:

{

"type": 144,

"parent_id": 5627091,

"name": "example.txt",

"file": "UXVlc3RvIMOoIHVuIGZpbGUgZGkgZXNlbXBpbw=="

}

but we get the following error: "error": "An illegal attempt was made to upload a document".

We tried the base64 encode. The user has full permissions to create documents in the folder.

Can anyone help us? Thank you.

Simone

Answers

  • appuq
    appuq Member
    edited November 16 #2

    AFAIK I have not seen a working example of sending a file as base64 you could try posting a file using multipart/form-data that is how Nodes with initial Version and Further adding versions happen

    In this post below, I have included how you can use SmartUI and then trace the payload of a File addition.

    try to look at this post

    There is some stuff being said it was perhaps a few days before

    https://forums.opentext.com/forums/developer/discussion/comment/969775#latest

    https://forums.opentext.com/forums/developer/discussion/312086/does-create-document-in-v2-nodes-api-support-multipart-form-data#latest