Create

POST /clubs/{clubID}/events: Creating a club event

Note: Only a club owner or club managers can create a club event

{
"Name": string,
"Description": string,
"DateTime": DateTime,
"Location": string,
"Fee": float
}

Example Request

This is a protected route, a valid JWT is required in the header field

Header

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTU4MjQyNzUsImlhdCI6IjIwMjAtMDctMjdUMDA6MjY6MTUuNzg5NTg0Mi0wNDowMCIsInN1YiI6ImNocmlzIn0.5US2_ITKcfgkpEbfsR-gxXbGPFY6XsgJPcGA5qaBD1M

Body

{
"Name": "Fantastic Event",
"Description": "A very good event",
"DateTime": "2020-08-25T09:50:45+00:00",
"Location": "In-Person",
"Fee": 30
}

Parameters


Name (Required)

Min: 1 character
Max: 50 characters


Description (Required)

Min: 0 characters
(Note: If no description is specified, then the Description field would be left as "Description": "")
Max: 300 characters


DateTime (Required)

Note: DateTime must be in the RFC3339 format. (i.e. YYYY-MM-DDTHH-MM-SS+00:00)


Location (Required)

Min: 0 characters
(Note: If no location is specified, then the Location field would be left as "Location": "")
Max: 300 characters


Fee (Required)

Value: The event fee must be greater or equal to 0


Possible Responses

Immediate Success

{
"code": 1,
"message": "successfully created event",
"data": {}
}

Failure

{
"code": -1,
"message": "club not found",
"data": {}
}
{
"code": -1,
"message": "unable to create event",
"data": {
"admin": "you must be a manager or owner of the club",
"name": "event name must be at least 1 character and a maximum of 50 characters",
"description": "event description must be a maximum of 300 characters or less",
"datetime": "datetime must be in the RFC3339 format and the event must occur later than the current time",
"location": "event location must be a maximum of 100 characters or less",
"fee": "fee must be greater or equal to 0"
}
}
Last updated on by Chris Lim