GET /assessment/:assessment_id/
Result:
{
...
"images": [
{
"id": 3,
"featured": true || false, # Only one image can be featured
"note": "...",
"url": "...",
"width": 350,
"height": 600,
"thumbnail_url": "..."
"thumbnail_width": 350,
"thumbnail_height": 600,
},
{ ... }
]
}
POST /assessment/:assessment_id/featured-image (set_featured_image)
Request:
{ "id": 7 }
POST /assessment/:assessment_id/images/ (upload_image)
Request: Contains single multipart-encoded file
DELETE /images/:image_id/ (delete_image)
Getting the gallery
added trailing slash:
GET /assessment/<x>/Result:
what's
Xunder"featured"? A flatter structure would make more sense to me:Changing the featured image
This one's tricky, I'm not sure the most suitable thing to do here!
PATCH /assessment/<x>/(set_featured_image)Request:
this request body doesn't feel quite right to me:
Uploading a new image
added trailing slash
changed description to
upload_imagerather thanupload_imagesPOST /assessment/<x>/images/(upload_image)Request:
Contains single multipart-encoded file
Deleting one image
DELETE /assessment/<x>/images?ids=5(delete_images)Two things
DELETE /images/:image_id/(delete_image)Deleting many images
Personally I'd just keep it simple and don't offer this
DELETE /assessment/<x>/images?ids=5,3,6,7(delete_images)