I'm trying to use Content Server's REST API to append a version to a document. Specifically, I'm trying to use /api/v2/nodes/{nodeId}/versions API call. I'd like to get this one working before I start trying to use the large file upload API.
Strangely, unlike the case for creating a net new document, CS is expecting an x-www-form-urlencoded request as opposed to FormData. With the latter, you can upload as a stream, and from Postman, you can make the parameter of type File which will allow you to choose the file to be embedded in the request. In the documentation, it specifies that the body is expected to have a file parameter of type string($binary) which I presume to mean a stringified version of the file contents. I tried with just the file parameter in my request to be just some text, i.e "This is some text content to be appended as a version", and I tried the same but with a body parameter with file as a JSON param (i.e. {"file": "This is some text…."}
Neither work. With or without the CS file upload setting set, they fail. it looks like Content Server is looking for a filename in the file parameter - which would be meaningless unless I am able to stream the file contents into the request somehow.
Can anyone tell me how I should be formatting an Add Version request in Postman? If I can get it working there, I can figure out how to get it working elsewhere.
Thanks in advance