Download API
This operation allows to generate and download a CSV file for a specified resource by performing the following POST request:
http://[hostName]:[portNumber]/[api-context-root]/generic/{resourceName}/download
Details
This endpoint generates a CSV file that contains data filtered by the specified query parameters (q). The endpoint supports the following additional request parameters:
-
groupBy(optional): Groups the results by one or more attributes. -
aggregate(optional): Specifies the aggregation operation to apply.
The service applies the requested filters and writes the resulting data set to the CSV file.
For information about the available resource attributes, see the HTTP API definition of the respective resource.
The following is mandatory to specify:
-
resourceRepresentation:fields- only thefieldsspecified in the request body are included in the CSV file. -
When list (array) attributes is request, each record is tilde (~) separated and fields of the record are number sign (#) separated.
When the request includes list (array) attributes, the CSV output uses the following delimiters:
-
The tilde (~) character separates individual records in the list.
-
The number sign (#) character separates fields within each record.
For example: record1Field1#record1Field2~record2Field1#record2Field2
Downloading Data from Special Integration Points
Some special integration points also support data downloads. Obtain the download path, the POST method, and the required request details from the HTTP API metadata for the integration point.
Use the Download API for adjustment rules and other special integration points. If an integration point supports the Query API, include the applicable query details to restrict the downloaded data. If an integration point does not support the Query API, the download includes all data available through that integration point.
Response
Success Response
A successful request returns the following:
- HTTP Response Code
HTTP/1.1 200 OK
- Response Body
-
-
Streamed CSV content.
-
The client or browser writes the
.csvfile to the local system as the response data is received.
-
If CWC and Limit have the same code, which is unlikely, the output shows one of them based on the order in which the back end evaluates the parameter aliases.
|