Overview
API allows caller to download the previously requested document package that has been produced.
As packages can be quite large in size, the API supports resume of the download, i.e., after download package is still available and can be accessed until scheduled deletion date that can be viewed by retrieving package status information.
Package returned is in one of the three formats requested - CSV
(only for summaries), JSON
, XML
. The actual file served back is ZIP compressed to reduce the time of transfer and save bandwidth.
Signature
API is REST based API that takes unique ID of the request/package as URL parameter and returns ZIPed resulting document content.
Signature:
GET /api/v1.0/documentpackages/{rid}
Inputs
This API accepts standard eInvoicing API header parameters for authenticated call.
URL parameter | Type | Description | Value example |
---|---|---|---|
rid | String | Unique ID of the package/request that was returned back to caller when package request was submitted. | 45KJHHA62D |
Outputs
Successful Response
API returns HTTP status code 200
when the package is ready to download, 204
when package is not yet ready.
When package is ready to download, the resulting body is a ZIP compressed file that contains JSON, XML or CSV content based on initial request.
Additional header parameters are returned as a result of this call.
Header parameter | Type | Description | Value example |
---|---|---|---|
Content type | String | Defines that binary downloadable data is provided. | application/octet-stream |
Content length | Number | Size of the file in KB | 8838849 |
The data included in the file depends on query criteria and also type requested - summary or full:
full
- returns full document objects as they were submitted by the submitter with additional added metadata and validation information serialized as part of hte resulting JSON or XML object. The structure of the data retrieved for each document whenfull
data set requested is the same as defined in Get Document API definition.summary
- returns summary document information only similar to the data structure returned by the Get Recent Documents API in a row like structure (flat single row records).
Error Response
Error situations are reported back by this API through the standard error response.
Additional specialized error messages can be returned:
HTTP Status Code | Error Code | Description |
---|---|---|
403 | Forbidden | Returned when caller of the endpoint is trying to download document package while caller profile has ‘B2B Deny ERP Document Retrieval’ tag assigned to it by ETA Admin. |
Additional considerations
To get the ID used to call this API, taxpayer system needs to first call API returning list of the document package requests or the ID returned during request submission should be used.