API Documentation

/api/user/create/<username>

Endpoint to create a user

Method: POST
Parameters:
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:
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:
Response: JSON - {'message': 'Uploaded successfully'} or {'error': 'Invalid file type'}

/api/delete

Endpoint to delete a photo

Method: DELETE
Parameters:
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:
Response: Image or video preview

/api/asset/<photo_id>

Endpoint to get a photo/video original

Method: GET
Parameters:
Response: Original photo or video

/api/list/general

Endpoint to get a list of photos/videos

Method: POST
Parameters:
Response: JSON - {"date": [list of photo IDs on that date]}

/api/details/<photo_id>

Endpoint to get asset details

Method: GET
Parameters:
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:
Response: JSON - {'message': 'Date changed successfully'}

/api/list/faces

Endpoint to get a list of faces

Method: GET
Parameters:
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:
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:
Response: JSON - face_name

/api/face/image/<face_id>

Endpoint to get the image of a face

Method: GET
Parameters:
Response: Image - Face image

/api/assetface/<asset>

Endpoint to get a list of faces in a photo with coordinates

Method: GET
Parameters:
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:
Response: JSON - "Faces joined successfully"

/api/face/delete/<face_id>

Endpoint to delete a face

Method: DELETE
Parameters:
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:
Response: JSON - "Faces replaced successfully"

/api/face/rename/<face_id>/<name>

Endpoint to rename a face

Method: GET
Parameters:
Response: JSON - "Face renamed successfully"

/api/family/move/<asset_id>

Endpoint to move personal assets to family

Method: POST
Parameters:
Response: JSON - "Image moved to family successfully"

/api/family/moveback/<asset_id>

Endpoint to move family assets back to personal

Method: POST
Parameters:
Response: JSON - "Image moved to <username> successfully"

/api/search

Endpoint to search the assets

Method: GET
Parameters:
Response: JSON - List of asset IDs