POST
Converts a document to another supported format.
The following sample converts a document to a PDF document.
# Request:
curl --location --request POST 'https://trial.dsserver.io/documentprocessing/document/convert?returnFormat=PDF' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer GphAd1R0npJM9OuX2y9mUa4cfqPMOg6p' \
--data-raw '"0M8R4KGxGuEAAAAA[..]="'
# Result:
"UEsDBBQAAAAIAAACAAC5EQAAAAADKSKHJHDuHDJJSHHD[..]="| Name | Type | Value | Optional |
|---|---|---|---|
| return |
String | A string that specifies the format of the created document. Possible values are: "PDF", "PDFA", "RTF", "DOC", "DOCX", "HTML" and "TX". Default value is "PDF". | yes |
| flatten |
Boolean | A boolean value that specifies whether form fields in the document should be replaced by their current content / value. Default value is false. | yes |
| Type | Value |
|---|---|
| String | The source document encoded as a Base64 string. Possible document formats are .rtf, .doc, .docx, .html, .pdf and .tx. |
| Status | Description |
|---|---|
| 200 | On success, the HTTP status code in the response header is 200 (OK). The response body contains the converted document encoded as a Base64 encoded string. |
| Status | Description |
|---|---|
| 401 | A 401 (Unauthorized) is returned, if the user is not authorized. |
| 400 | A 400 (Bad Request) is returned, if no data is found in the Merge |
| 400 | A 400 (Bad Request) is returned, if DS Server is not licensed or the license is invalid. |
| 400 | A 400 (Bad Request) is returned, if the uploaded document is not valid. |