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.
Save generated content as a new notepad document. This is only possible if the GenerationJob succeeded.
Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:notepad-write.
stringThe unique identifier for a Template
stringThe unique identifier for a GenerationJob
objectstringThe name of the document to save. If not provided, a name will be generated.
stringThe parent folder to save the document in.
objectResponse for saving a document
stringThe RID of the newly created document
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/generationJobs/ri.notepad.main.generation-job.ab12c039-353c-4555-9704-eacfdfaa2c1c/saveDocument?preview=true" \
-d '{"parentFolderRid":"ri.compass.main.folder.c410f510-2937-420e-8ea3-8c9bcb3c1791"}'1
2
3
{
"documentRid": "ri.notepad.main.notepad.ef32c039-353c-4555-9704-eacfdfaa2c1c"
}| Error Name | ||
|---|---|---|
Generation | Error Code | FAILED_PRECONDITION |
| Status Code | 500 | |
| Description | The operation cannot be completed because the generation job has failed status. | |
| Parameters | generationJobRid | |
Generation | Error Code | FAILED_PRECONDITION |
| Status Code | 500 | |
| Description | The operation cannot be completed because the generation job has running status. | |
| Parameters | generationJobRid | |
Invalid | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | The display name of a Resource should not be exactly `.` or `..`, contain a forward slash `/` and must be less than or equal to 700 characters. | |
| Parameters | displayName | |
Resource | Error Code | CONFLICT |
| Status Code | 409 | |
| Description | The provided resource name is already in use by another resource in the same folder. | |
| Parameters | parentFolderRid, displayName | |
Invalid | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | The given Resource is not a Folder. | |
| Parameters | resourceRid | |
Save | Error Code | PERMISSION_DENIED |
| Status Code | 403 | |
| Description | Could not saveDocument the GenerationJob. | |
| Parameters | generationJobRid, templateRid | |
Folder | Error Code | NOT_FOUND |
| Status Code | 404 | |
| Description | The given Folder could not be found. | |
| Parameters | folderRid | |
See Errors for a general overview of errors in the platform.