Batch Image Upload
Endpoint
Section titled “Endpoint”URL: https://nursery.ankurplus.com/batch_image_upload
Method: POST
Request Body
Section titled “Request Body”Send a JSON payload containing the parameters object:
{ "parameters": { "nursery_id": 2, "user_id": 1, "JWT_code": "wdwewewewe", "batch_id": 1, "file_id": 10, "image_type": "ROOT" }}Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
nursery_id | number | Yes | Identifier of the nursery the batch belongs to |
user_id | number | Yes | ID of the logged-in user performing the action |
JWT_code | string | Yes | JWT token for authenticating the current user |
batch_id | number | Yes | Identifier of the batch receiving the image |
file_id | number | Yes | ID of the file that was previously uploaded |
image_type | string | Yes | Logical type/classification for the image (e.g. ROOT) |
Response
Section titled “Response”Success Response
Section titled “Success Response”{ "success": true, "data": { "file_id": 10, "file_name": "NjMWJyf5UxtZFOu.png", "type": "ROOT" }}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
success | boolean | Indicates whether the request completed normally |
data | object | Wrapper for the details of the newly linked image |
data.file_id | number | Identifier of the linked file |
data.file_name | string | Generated filename stored in the system |
data.type | string | Image type that was saved (matches image_type) |
Workflow
Section titled “Workflow”- Upload asset using the generic image upload endpoint (
image_upload).
Example response:
{ "success": true, "file_name": "3C1mogOuQw8wV4k.pdf", "file_type": "application/pdf", "file_extension": "pdf", "file_size": 519, "file_bucket": "PUBLIC"}-
Associate the uploaded file with a batch using this
batch_image_uploadendpoint.
(Use thefile_idreturned from the first call.) -
Retrieve batch images with the
load_batch_imagesendpoint to confirm the attachment.
load_batch_images Reference
Section titled “load_batch_images Reference”Inputs: nursery_id, batch_id, user_id, JWT_code
Response:
{ "success": true, "data": [ { "file_id": 1, "filename": "tyetywteyw.png", "type": "ROOT", "upload_date": null } ]}