Skip to main content

Download Multiple Farmer Batch Reports

GET /api/v1/trades/farmer/batch/multiple/download/{format}

Description

Enables the download of aggregated batch reports for multiple farmers within a trade, formatted according to the specified file type. This endpoint is particularly useful for exporting comprehensive batch data for analysis, reporting, or compliance purposes across multiple farmers involved in agricultural trades.

URL Parameters:

  • format (required): The file format in which the batch reports are to be downloaded. Common formats could include PDF, CSV, XLSX, etc., depending on the system's support. This must be included in the URL path.

Example Request:

curl -G "http://[base_url]/api/v1/trades/farmer/batch/multiple/download/{format}" \
-H "Authorization: Bearer [access_token]"

Responses:

  • 200 OK: Successfully retrieves the batch report files in the requested format. Depending on the API's configuration, this might be served as a direct file download or as a URL to the file.

Example Response: The response could potentially initiate a file download action from the server. The specific content type would vary based on the requested format (e.g., application/pdf for PDF). Here is an example header that might be included:

Content-Disposition: attachment; filename="multiple-batch-reports.{format}"

Error Responses:

  • 400 Bad Request: Incorrect parameters provided, such as an unsupported file format.
  • 404 Not Found: The requested data or format is not available.
  • 403 Forbidden: The user does not have the necessary permissions to download these reports.

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request GET \ 
--url /api/v1/trades/farmer/batch/multiple/download/{format} \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!