Skip to content

Batch Image Upload

URL: https://nursery.ankurplus.com/batch_image_upload
Method: POST

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"
}
}
ParameterTypeRequiredDescription
nursery_idnumberYesIdentifier of the nursery the batch belongs to
user_idnumberYesID of the logged-in user performing the action
JWT_codestringYesJWT token for authenticating the current user
batch_idnumberYesIdentifier of the batch receiving the image
file_idnumberYesID of the file that was previously uploaded
image_typestringYesLogical type/classification for the image (e.g. ROOT)
{
"success": true,
"data": {
"file_id": 10,
"file_name": "NjMWJyf5UxtZFOu.png",
"type": "ROOT"
}
}
FieldTypeDescription
successbooleanIndicates whether the request completed normally
dataobjectWrapper for the details of the newly linked image
data.file_idnumberIdentifier of the linked file
data.file_namestringGenerated filename stored in the system
data.typestringImage type that was saved (matches image_type)
  1. 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"
}
  1. Associate the uploaded file with a batch using this batch_image_upload endpoint.
    (Use the file_id returned from the first call.)

  2. Retrieve batch images with the load_batch_images endpoint to confirm the attachment.

Inputs: nursery_id, batch_id, user_id, JWT_code

Response:

{
"success": true,
"data": [
{
"file_id": 1,
"filename": "tyetywteyw.png",
"type": "ROOT",
"upload_date": null
}
]
}