Download Single Farmer Batch Report
GET /api/v1/trades/farmer/batch/single/download/{format}
Description
Allows users to download a batch report for a specific farmer in a trade in the specified file format. This feature is useful for exporting data related to agricultural batches, including details such as quantities, batch IDs, and related transactional information in a structured file format for reporting, compliance, or analysis purposes.
URL Parameters:
format(required): The file format in which the batch report is to be downloaded. Possible values might includePDF,CSV,XLSX, etc., depending on what formats the system supports. This must be included in the URL path.
Description: Allows users to download a batch report for a specific farmer in a trade in the specified file format. This feature is useful for exporting data related to agricultural batches, including details such as quantities, batch IDs, and related transactional information in a structured file format for reporting, compliance, or analysis purposes.
Example Request:
curl -G "http://[base_url]/api/v1/trades/farmer/batch/single/download/{format}" \
-H "Authorization: Bearer [access_token]"
Responses:
- 200 OK: Successfully retrieved the file. The response includes the batch report file in the requested format. Depending on the API's implementation, this might be served as a direct file download or as a URL to the file.
Example Response:
The response would be a file download action initiated by the server, and the specific content type would vary based on the format requested (e.g., application/pdf for PDF). Here is an example header that might be included:
Content-Disposition: attachment; filename="batch-report.{format}"
Error Responses:
- 400 Bad Request: Incorrect parameters provided, such as an unsupported format.
- 404 Not Found: The requested file or data format is not available.
- 403 Forbidden: The user does not have permission to download the batch report.
LANGUAGE
CURL REQUEST
curl --request GET \
--url /api/v1/trades/farmer/batch/single/download/{format} \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!