REST API to access document rendered with associated template

Hi, Having created a document with the REST API, I can, on the web interface, generate a docx file rendering, using a docx template associated with this document type. Is it possible to programmatically generate this rendering, and access the docx file generated, with the REST API ? Thanks,

0 votes

1 answers

750 views

ANSWER



I answer myself, after a more thorough reading of the documentation.

The URL to get the rendered document is not in the /api/v1/etc… , but in the nxtemplate namespace; the URL nxtemplate/document-path@model-name renders the document and returns the rendered result.

Example: GET http://nuxeo.mycompany.com:8080/nuxeo/nxtemplate/default/stages-conventions/convention-test-eleve-01@stage-convention-modele-01 … returns a docx binary file, Where:

  • stages-conventions is a workspace directory,
  • stage-convention-modele-01 is the name of a nuxeo template containing a docx template document
  • convention-test-eleve-01 is a nuxeo document associated with the template
1 votes