API Documentation
/api/user/create/<username>
Endpoint to create a user
Method: POST
Parameters:
- username (string) - User's name
Response: JSON - {'message': 'User created successfully'} or {'error':
'User already exists'}
/api/user/rename/<username>/<new_username>
Endpoint to rename a user
Method: POST
Parameters:
- username (string) - Current username
- new_username (string) - New username
Response: JSON - {'message': 'User renamed successfully'} or {'error':
'User not found'} or {'error': 'User already exists'}
/api/upload
Endpoint to upload photos/videos
Method: POST
Parameters:
- username (string) - User's name
- asset (file) - Photo or video to upload
- compress (optional) - Whether to compress the asset
Response: JSON - {'message': 'Uploaded successfully'} or {'error':
'Invalid file type'}
/api/delete
Endpoint to delete a photo
Method: DELETE
Parameters:
- username (string) - User's name
- id (string) - ID(s) of the photo(s) to delete (comma-separated)
Response: JSON - {"success": [list of successfully deleted photo IDs],
"failed": [list of failed to delete photo IDs]}
/api/preview/<username>/<photo_id>
Endpoint to get a photo/video preview
Method: GET
Parameters:
- username (string) - User's name
- photo_id (int) - ID of the photo/video
Response: Image or video preview
/api/asset/<photo_id>
Endpoint to get a photo/video original
Method: GET
Parameters:
- photo_id (int) - ID of the photo/video
- username (optional) - User's name
Response: Original photo or video
/api/list/general
Endpoint to get a list of photos/videos
Method: POST
Parameters:
- username (string, optional) - User's name
Response: JSON - {"date": [list of photo IDs on that date]}
/api/details/<photo_id>
Endpoint to get asset details
Method: GET
Parameters:
- photo_id (int) - ID of the photo/video
- username (string, optional) - User's name
Response: JSON - {"name": "Photo name", "tags": ["tag1", "tag2"],
"date": "dd-mm-yyyy", "time": "hh:mm", "format": "file format",
"compress": true/false, "fps": "video frame rate", "width": "width in
pixels", "height": "height in pixels", "size": "file size", "faces":
[list of face IDs], "location": null}
/api/redate
Endpoint to change date of assets
Method: POST
Parameters:
- username (string, optional) - User's name
- date (string) - New date in YYYY-MM-DD format
- time (string) - New time in HH:MM format
-
id (string) - ID(s) of the photo(s)/video(s) to change date
(comma-separated)
Response: JSON - {'message': 'Date changed successfully'}
/api/list/faces
Endpoint to get a list of faces
Method: GET
Parameters:
- username (string, optional) - User's name
Response: JSON - {face_id: face_name}
/api/list/face/<face_id>
Endpoint to get a list of photos/videos grouped by date for a particular
face
Method: GET
Parameters:
- username (string) - User's name
- face_id (int) - ID of the face
Response: JSON - {date: [list of photo/video IDs on that date]}
/api/face/name/<face_id>
Endpoint to get the name of a face
Method: GET
Parameters:
- username (string, optional) - User's name
Response: JSON - face_name
/api/face/image/<face_id>
Endpoint to get the image of a face
Method: GET
Parameters:
- username (string, optional) - User's name
Response: Image - Face image
/api/assetface/<asset>
Endpoint to get a list of faces in a photo with coordinates
Method: GET
Parameters:
- username (string, optional) - User's name
Response: JSON - [{"faceid": face_id, "x": x, "y": y, "w": width, "h":
height}]
/api/face/join/<main_face_id1>/<side_face_id2>
Endpoint to join two faces
Method: POST
Parameters:
- username (string, optional) - User's name
Response: JSON - "Faces joined successfully"
/api/face/delete/<face_id>
Endpoint to delete a face
Method: DELETE
Parameters:
- username (string, optional) - User's name
Response: JSON - "Face deleted successfully"
/api/face/replace/<new_face_id>/<asset_id>/<x>/<y>/<w>/<h>/
Endpoint to replace a face
Method: POST
Parameters:
- username (string, optional) - User's name
Response: JSON - "Faces replaced successfully"
/api/face/rename/<face_id>/<name>
Endpoint to rename a face
Method: GET
Parameters:
- username (string, optional) - User's name
Response: JSON - "Face renamed successfully"
/api/family/move/<asset_id>
Endpoint to move personal assets to family
Method: POST
Parameters:
- username (string, optional) - User's name
Response: JSON - "Image moved to family successfully"
/api/family/moveback/<asset_id>
Endpoint to move family assets back to personal
Method: POST
Parameters:
- username (string, optional) - User's name
Response: JSON - "Image moved to <username> successfully"
/api/search
Endpoint to search the assets
Method: GET
Parameters:
- username (string, optional) - User's name
Response: JSON - List of asset IDs