Overview
The Photos API provides endpoints for uploading, managing, and retrieving photos associated with memorabilia items in your collection. Base URL:/api/photos/
Authentication: Token authentication required for all endpoints.
Interactive API Documentation
Full interactive API documentation for photo endpoints is available at
/api/docs/ when running the FootyCollect server. The Swagger UI interface allows you to explore and test all endpoints with real-time responses.OpenAPI Schema
The complete OpenAPI schema for photo endpoints is available at:Photo Model
Photos are associated with items using Django’s GenericForeignKey pattern (seefootycollect/collection/models.py:52-154):
Unique identifier for the photo
Content type ID for the associated object
ID of the associated object (item)
The uploaded image file
AVIF-optimized version of the image (auto-generated)
Optional caption for the photo
Display order of the photo (for sorting)
When the photo was uploaded
ID of the user who uploaded the photo
Features
Automatic Image Optimization
FootyCollect automatically creates AVIF versions of uploaded photos for better performance and smaller file sizes. This process is handled asynchronously using Celery tasks.Thumbnail Generation
Thumbnails (100x100px) are automatically generated for all uploaded photos using ImageKit.Photo Ordering
Photos can be reordered using theorder field. The first photo (order=0) is typically used as the main photo for an item.
RESTful Conventions
Photo endpoints follow standard RESTful conventions:GET /api/photos/- List all photosPOST /api/photos/- Upload a new photoGET /api/photos/{id}/- Retrieve a specific photoPUT /api/photos/{id}/- Full update of a photoPATCH /api/photos/{id}/- Partial update of a photo (e.g., caption, order)DELETE /api/photos/{id}/- Delete a photo
Sample Upload Request
Sample Response
File Storage
Photos are stored in the
/media/item_photos/ directory, with AVIF versions in /media/item_photos_avif/. The application supports both local file storage and cloud storage (S3-compatible).Cleanup
Learn More
OpenAPI Documentation
Access the full interactive API documentation with request/response examples and the ability to test endpoints directly.
OpenAPI Schema
Download the complete OpenAPI specification for integration with API clients and code generation tools.