Greetings to all of you,
Now that i have a document uploaded via “/api/v4/documents/upload/” i was testing “/api/v4/documents/15/versions/” to upoad a new version of the document. on the Front-end the new version is shown under versions menu and it shows as a stub only with no preview and the active version is still the first version. can any body help please.
Thanks
so i was able to resolve this with the following “/api/v4/documents/15/files/” and form-data "–form ‘file_new=@“postman-cloud:///1ef8d24a-e692-4480-b33b-f18d6a5be5cb”’
–form ‘action=“1”’ "
Since a document version can contain pages from multiple files to allow merging and recomposition, creating a document version does so but without any pages.
Afterwards you call the document version modification endpoint to specify what is going to be the document version page composition.
There is shortcut also provided as you found in the file upload endpoint that allows you to pass how the newly created version from the file upload will be composed. This shortcut mirrors the UI flow which also provides the dropdown of options.
Since version 4.5 the action
parameter which used to accept a number is now named action_name
and requires the action short name for greater context.
https://docs.mayan-edms.com/releases/4.5.html#id6
The list of available actions is not hardcoded but detected during startup and can be accessed via the endpoint /document_version_modification_backends/
By default the most common two actions are included which is to reset the page or to append but custom apps can easily add their own by subclassing DocumentVersionModification
.
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.