This endpoint is in preview and may be modified or removed at any time.
To use this endpoint, add preview=true to the request query parameters.
Creates a new GenerationJob. The template generation job will produce new document content by applying template parameters to an existing template. If the GenerationJob succeeds, the resulting contents can be saved as a new Document or exported to a File.
The user must have the api scope to create GenerationJobs. Once created a GenerationJob is only accessible to the user that created it.
Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:notepad-write.
objectstringThe published version of the template to use. If not provided, the latest published version will be used.
map<TemplateParameterName, TemplateParameterValue>The parameters to apply to the template during generation.
1
2
3
4
5
curl -X POST \
\t-H "Content-type: application/json" \
\t-H "Authorization: Bearer $TOKEN" \
"https://$HOSTNAME/api/v2/notepad/templates/ri.notepad.main.notepad-template.bef90a51-d37d-4983-abde-56e5bd0fcf52/generate?preview=true" \
-d '{"templateParameters":{"customerName":{"type":"string","value":"John Doe"}},"templateVersion":42}'1
ri.notepad.main.generation-job.ab12c039-353c-4555-9704-eacfdfaa2c1c| Error Name | ||
|---|---|---|
Template | Error Code | NOT_FOUND |
| Status Code | 404 | |
| Description | The requested template was not found. | |
| Parameters | templateRid | |
Invalid | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | The provided timezone is not valid. | |
| Parameters | userTimezone | |
Invalid | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | The provided template version doesn't exist or the template has no published versions. | |
| Parameters | templateVersion | |
Missing | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | One or more template parameters are missing. | |
| Parameters | templateParameterNames | |
Invalid | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | A template parameter value is invalid (for example, is of the wrong type). | |
| Parameters | templateParameterName, reason | |
Generate | Error Code | PERMISSION_DENIED |
| Status Code | 403 | |
| Description | Could not generate the Template. | |
| Parameters | templateRid | |
See Errors for a general overview of errors in the platform.