Create and run an action to export an image file

post/reports/{reportId}/exportImage
Internal-Use Only

Start a job from the request information that creates and exports the image as an SVG file or a PNG file.

Request Samples

1

Response Samples

1{
2 "version": 1,
3 "id": "35be55e4-75ce-4ece-8d74-ed786273e035",
4 "state": "completed",
5 "inputReport": "/reports/reports/cbf97b0a-457d-4b4f-8913-547e0cdf390c",
6 "resultMediaType": "image/svg",
7 "creationTimestamp": "2022-03-14T19:23:40.1684707Z",
8 "endTimestamp": "2022-03-14T19:23:46.1390352Z",
9 "links": [
10 {
11 "method": "GET",
12 "rel": "self",
13 "href": "/visualAnalytics/jobs/35be55e4-75ce-4ece-8d74-ed786273e035",
14 "uri": "/visualAnalytics/jobs/35be55e4-75ce-4ece-8d74-ed786273e035",
15 "type": "application/vnd.sas.visual.analytics.report.export.image.job",
16 "responseType": "application/vnd.sas.visual.analytics.report.export.image.job"
17 },
18 {
19 "method": "DELETE",
20 "rel": "delete",
21 "href": "/visualAnalytics/jobs/35be55e4-75ce-4ece-8d74-ed786273e035",
22 "uri": "/visualAnalytics/jobs/35be55e4-75ce-4ece-8d74-ed786273e035"
23 },
24 {
25 "method": "GET",
26 "rel": "result",
27 "href": "/reportImages/images/K1234885385B1757751810.svg",
28 "uri": "/reportImages/images/K1234885385B1757751810.svg",
29 "type": "image/svg+xml"
30 }
31 ],
32 "reportObject": "Dual Axis Bar-Line - Merchandise Hierarchy 1",
33 "timeout": 60,
34 "wait": 30
35}

Path Parameters

NameTypeRequiredDescription
reportId
string
true

Identifier of an existing report resource. Report identifiers are generated by the Reports API when reports are created.

Examples:
"12345678-abcd-ef12-3456-123456789abc"

Header Parameters

NameTypeRequiredDescription
Accept-Language
string
false

The user's language, which is used in both rendering and caching. For technical details, see "/tools.ietf.org/html/rfc7231#section-5.3.5" It affects the language of reports if they have been translated. This setting overrides any other user preference that has been set, such as the "offline process locale" preference in Visual Analytics. If this header is not set and there is no user preference, the language is the default language of the service.

Accept-Locale
string
false

A "format locale" that is distinct from the user's language (Accept-Language). Its syntax is similar to Accept-Language. It is honored in running of queries and formatting of values. This setting overrides any other user preference that has been set, such as the "regional locale for formats" preference in Visual Analytics. If this header is not set and there is no user preference, the format locale is the default locale of the service.

Request Body

Information about the image that is to be exported. It is to be determined whether the entire body is optional, since in the first iteration of this operation, defaults can be supplied by the system for all of the fields. If an empty body is supplied in the request, a representative normal layout image of the default size is rendered of the first page of the report. The report is saved with a generated name in the personal folder of the caller's identity.

NameTypeRequiredDescription
resultFolder
string
false

The URI of the folder in which the output file should be created. Specifying a folder URI allows the result to be visible in user interfaces that show files, and it puts the lifetime of the result file in the control of the client. If the result folder is not specified, the result file is transient; the system can clean up results on its own schedule, and it retains control of the lifetime of the file. The client can specify placeholder "/folders/folders/@myFolder" to save it in the user's personal folder. If the folder is specified and does not exist, it is an error.

resultFilename
string
false

The user-visible file name of the output when it is saved in a folder on the server. If the resultFolder is provided and no resultFilename is specified on the request, the service gives the file a default name. On a running or completed job, the file name is either the requested name, optionally modified by the system to avoid name conflicts, or if the request specified no file name, it is the name generated by the system.

Example:
"Sample Output File Name.svg"
nameConflict
string
false

The strategy for handling name collision when saving the result file. The value replace means overwrite any pre-existing file. The value rename specifies that the service should modify the requested name to be unique, such as by appending a number to the name. The default value is rename.

Allowed values:
replacerename
reportObject
string
false

The name of the report object to render in the exported file. If this is left empty, the image will be a rendering of the first page of the report. Report objects include visual elements like graphs, tables, visual containers that the author has created in the layout, and complete pages. Specifying the object by its label makes it more convenient for the report author or viewer and does not to expose the internal names of objects in the model. However, if the client knows the internal identifier of a report object, it can be used instead of the label.

Example:
"Dual Axis Bar-Line - Merchandise Hierarchy 1"
image
ExportImageOptions
true

Values needed for rendering the image.

timeout
integer
false

After creation of the job, the maximum number of seconds it will be allowed to run before timing out. The default maximum is a system configuration value. This option allows the maximum to be modified for this request, but its value cannot exceed a system-configured maximum limit. There is no guarantee that all background processes can be terminated when time-out is exceeded, but an attempt will be made where it is possible.

Example:
60
wait
integer
false

Number of seconds to wait before returning from the initial POST to start the job. The default value is effectively zero, meaning to return the running job to the client as soon as it is created. Specifying a positive value instructs the server to wait on the running job for the specified number of seconds because the client expects the job to finish quickly. This allows the client to avoid having to poll for completion. It should be used cautiously because job durations are unpredictable.

Example:
30
version
integer
true

Version of this request object, which is currently version 1.

Responses

StatusMeaningDescription
201CreatedThe job ran and completed within the wait time allotted. The response body contains links to the job object, which contains information about result output.HeadersSchema
202AcceptedThe job has been created. The response body contains links to requery for results and status of the job. This is expected to be the most usual case.HeadersSchema
400Bad RequestThere was an error in the request.HeadersSchema