Skip to content

Upload a Gallery Photo

POST api/gallery/upload

This is used to upload a gallery photo.

Example Request

Terminal window
curl -X 'POST' \
'http://localhost:8080/api/gallery/upload' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'event_id=<event_id>' \
-F 'image=<file_path>'

Parameters

event_id

Type: Form Data
Data Type: Integer
Required: Yes
Description: The unique identifier of the event

image

Type: Form Data
Data Type: Image File
Required: Yes
Description: The image file for the gallery photo

video

Type: Form Data
Data Type: Video File (Accepts: mp4,mov,avi and wmv)
Required: Yes
Description: The video file for the gallery photo

Responses

200 - OK

The request was successful

Content Type: application/json
Content: Gallery Photo

{
"id": "string",
"event_id": "string",
"event_photo_url": "string",
"event_photo_preview_url": "string",
"event_photo_likes_count": "string",
"event_photo_comments_count": "string",
"liked": true,
"taken_by": {
"id": 0,
"user_first_name": "string",
"user_middle_name": "string",
"user_last_name": "string",
"user_username": "string",
"user_avatar_url": "string",
"user_visible": "string"
},
"created_at": "2025-01-08T04:39:27.383Z",
"updated_at": "2025-01-08T04:39:27.383Z"
}

400 - Bad Request

Validation Error

Content Type: application/json
Content:

{
"param_name": [
"string"
],
"param_name_2": [
"string"
],
"error": "You're not authorized to upload an image for this event." | "You've exceeded the maximum number of photos allowed to be uploaded."
}

401 - Unauthorized

The request requires valid bearer token, but none were provided, or the bearer token is invalid.

404 - Not Found

The server could not find the requested resource.

Content Type: text/plain
Content:

Event not found

429 - Too Many Requests

The user has exceeded the rate limit of 120 requests per minute.

500 - Internal Server Error

There is an issue with the backend. Sentry will provide a more detailed report on the problem.