Export workbook canvas
/api/20210901/catalog/workbooks/{urlBase64WorkbookId}/exports
Request
- application/json
object
-
format(required): string
Allowed Values:
[ "pdf", "png" ]
The output format. -
name(required): string
The name of the output file.
-
type(required): string
Allowed Values:
[ "file" ]
The type of the entity.
object
-
canvasIds(required): array
canvasIds
A list of canvas IDs.
-
format(required): string
Allowed Values:
[ "pdf", "png" ]
The output format. -
name(required): string
The name of the output file.
-
screenheight(required): integer
Browser screen height. Maximum height is 3600.
-
screenwidth(required): integer
Browser screen width. Maximum width is 3600.
-
type(required): string
Allowed Values:
[ "file" ]
The type of the entity.
Response
202 Response
400 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
401 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
403 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
404 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
412 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
422 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
500 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
Examples
- name: The output file name.
- type: Output type. Type must be
file
. - canvasIds: IDs of the canvases in the workbook. Maximum 5 canvases. Maximum length of a canvasId is 2000 characters.
- format: Output format. Format must be
PDF
orPNG
. - screenwidth: Browser screen width. Maximum width is 3600.
- screenheight: Browser screen height. Maximum height is 3600.
payload.json
:{
"name": "Monthly report",
"type": "file",
"canvasIds": ["snapshot!canvas!1", "snapshot!canvas!2"],
"format": "pdf",
"screenwidth": 1440,
"screenheight": 900
}
Example - Request PDF Output from a Workbook with a JSON Payload
In this example, you request a PDF with two canvases from an existing
workbook with the given ID using the JSON file payload.json
. The
object ID of the workbook is '/shared/Sales/MySalesWorkbook' which has the
Base64URL-safe encoded ID value:
L3NoYXJlZC9TYWxlcy9NeVNhbGVzV29ya2Jvb2s
. You can get the ID of
a workbook by using Get catalog items by type.
Successful operation returns a work request ID, which in the example response is
biwj-J2MwOjQwOCcuJ2N3Ojc4NSc
. You can check the status of your
export request by passing the work request ID to Get a work request
item. Work request IDs are also referred to as export IDs.
cURL Example:
curl --header 'Authorization: Bearer <token>' --header 'Content-Type: application/json' --request POST 'http://<hostname>:<port>/api/20210901/catalog/workbooks/L3NoYXJlZC9TYWxlcy9NeVNhbGVzV29ya2Jvb2s/exports/ --data @payload.json'
Example of Request Body
Not applicable.
Example of Response Body
{ "resourceUri": "/api/20210901/catalog/workbooks/L3NoYXJlZC9TYWxlcy9NeVNhbGVzV29ya2Jvb2s/exports/biwj-J2MwOjQwOCcuJ2N3Ojc4NSc" }