Create and run an action to export a data file

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

Start a job from the request information to export the data for a report object as a datafile. The format of the file is specified by an option as comma-separated values, tab-separated values, or a spreadsheet in Excel format.

Request Samples

1

Response Samples

1{
2 "version": 1,
3 "id": "3234082d-841e-489d-a4b8-808a75c270b0",
4 "state": "completed",
5 "inputReport": "f4dd1ca2-1b82-4c90-bd6a-26bcd07bee39",
6 "resultFolder": "/folders/folders/@myFolder",
7 "resultFileName": "exportData",
8 "resultMediaType": "CSV",
9 "nameConflict": "rename",
10 "creationTimestamp": "2022-03-04T20:15:43.400236638Z",
11 "endTimestamp": "2022-03-04T20:15:46.478072423Z",
12 "links": [
13 {
14 "method": "GET",
15 "rel": "self",
16 "href": "/visualAnalytics/jobs/66d70ca3-c7ac-4460-bffb-bbeb4ab7ac35",
17 "uri": "/visualAnalytics/jobs/66d70ca3-c7ac-4460-bffb-bbeb4ab7ac35",
18 "type": "application/vnd.sas.visual.analytics.report.export.data.job+json",
19 "responseType": "application/vnd.sas.visual.analytics.report.export.data.job+json"
20 },
21 {
22 "method": "DELETE",
23 "rel": "delete",
24 "href": "/visualAnalytics/jobs/66d70ca3-c7ac-4460-bffb-bbeb4ab7ac35",
25 "uri": "/visualAnalytics/jobs/66d70ca3-c7ac-4460-bffb-bbeb4ab7ac35"
26 },
27 {
28 "method": "GET",
29 "rel": "result",
30 "href": "/files/files/84c4d7c7-3711-4d78-9a8f-cddae73c6318/content",
31 "uri": "/files/files/84c4d7c7-3711-4d78-9a8f-cddae73c6318/content"
32 }
33 ],
34 "format": "CSV",
35 "reportObject": "Dual Axis Bar-Line - Merchandise Hierarchy 1",
36 "properties": {
37 "RowCount": "5"
38 }
39}

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 visual element data that is to be exported. The reportObject property is required to export information about the underlying data. If the folder is not specified, the package is retained for a time, but will not be visible in file selection windows, such as in SAS Drive. It is cached temporarily by the Report Data service for a period of time sufficient for clients to check the status of the package job and download it.

NameTypeRequiredDescription
format
string
true

The format of the data file that will be exported. May be comma-separated values, tab-separated values, or an excel spreadsheet. The excel option does not provided special visual formatting of the data as a table, such as fonts and colors. It outputs only rows and columns of values. Individual data values are formatted according to their definitions in the original data sets or by the report author's data format selections.

Allowed values:
csvtsvxlsx
Default:
xlsx
reportObject
string
true

Visual element name or label

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
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
options
ExportDataOptions
false

Options for generating and downloading a data file in one of several formats. Supported formats are csv, tsv and xlsx.

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 RequestThe job failed with bad request errorHeadersSchema
403ForbiddenForbidden error.Schema