Document routes: render
The Document Verbs render as api.sb routes, with inputs, result, refusals and an example.
Reference for Document, one group of Document routes.
Document.render
Render produces a file from a Document in the format the reader asks for. Verb page.
POST /{namespace}/ documents/ {document}/ renderPath: document. Body, as JSON: the other inputs. Emits Document.rendered.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
document | Document | required | The Document to render. |
format | string | required | The file format. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
file | url | required | Where the file lives. |
document | Document | required | The Document rendered. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The input does not match the schema of the operation. | invalid-input | Read the schema of the operation, then send every required field with the right type. | None. |
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ documents/ document_af2wijcmRy/ render \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"format": "Example format"}'{
"api": "https: //api.sb/ leaseline.app",
"file": "https: //leaseline.app",
"document": {
"$id": "https: //api.sb/ leaseline.app/ documents/ document_af2wijcmRy",
"$type": "Document",
"form": "document"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Document.render",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}