Feel free to use & modify this API for register running club with its event
Endpoint : POST /api/users
Request Header : None
Allowed User : Any Role
Request Body:
{
"username" : "username",
"password" : "password",
"role" : "ROLE_ADMIN / ROLE_USER"
}Response Body:
{
"status": true,
"messages": "User registration success",
"errors": null,
"data": {
"username": "username",
"role": [
{
"role": "ROLE_ADMIN"
}
]
}
}Endpoint : GET /api/users/current
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Response Body:
{
"status": true,
"messages": "User fetching success",
"errors": null,
"data": {
"username": "username",
"role": [
{
"role": "ROLE_ADMIN"
}
]
}
}Endpoint : PATCH /api/users/current
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body:
{
"username" : "username",
"password" : "password"
}Response Body:
{
"status": true,
"messages": "User password update success",
"errors": null,
"data": {
"username": "bintang.ginanjar",
"role": [
{
"role": "ROLE_ADMIN"
}
]
}
}Endpoint : PATCH /api/users/role
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
Request Body:
{
"username" : "username",
"password" : "password"
}Response Body:
{
"status": true,
"messages": "User role update success",
"errors": null,
"data": {
"username": "username",
"role": [
{
"role": "ROLE_USER"
}
]
}
}Endpoint : GET /api/users/list
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
Response Body:
{
"status": true,
"messages": "User fetching success",
"errors": null,
"data": [
{
"username": "test",
"role": [
{
"role": "ROLE_ADMIN"
}
]
},
{
"username": "bintang.ginanjar",
"role": [
{
"role": "ROLE_USER"
}
]
},
{
"username": "admin",
"role": [
{
"role": "ROLE_ADMIN"
}
]
}
]
}Endpoint : POST /api/auth/login
Request Header : None
Allowed User : Any Role
Request Body:
{
"username" : "username",
"password" : "password"
}Response Body:
{
"status": true,
"messages": "Login success",
"errors": null,
"data": {
"token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJiaW50YW5nLmdpbmFuamFyIiwiaWF0IjoxNzM4OTAxNzM2LCJleHAiOjE3Mzk2MjE3MzZ9.UEZL76NRFLfYJ8vQNFjnvFc0thuoX9sL6qNen_yyMYIgGUiGozfJf10HG-Lb66Rs-RB7WdVfN4cl4yPqroUSzA",
"roles": [
"ROLE_ADMIN"
],
"tokenType": "Bearer "
}
}Endpoint : DELETE /api/auth/logout
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Response Body:
{
"status": true,
"messages": "User logout successfully",
"errors": null,
"data": null
}Endpoint : POST /api/clubs
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body:
{
"title" : "Daytona Running Club",
"content" : "Daytona Content",
"photoUrl" : "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}Response Body:
{
"status": true,
"messages": "Club registration success",
"errors": null,
"data": {
"id": 4,
"title": "Daytona Running Club",
"photoUrl": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg",
"content": "Daytona Content"
}
}Endpoint : GET /api/clubs/{clubId}
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body: None
Response Body:
{
"status": true,
"messages": "Club fetching success",
"errors": null,
"data": {
"id": 4,
"title": "Daytona Running Club",
"photoUrl": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg",
"content": "Daytona Content"
}
}Endpoint : PATCH /api/clubs/{clubId}
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body:
{
"title" : "Daytona Running Club",
"content" : "Daytona Content",
"photoUrl" : "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}Response Body:
{
"status": true,
"messages": "Club update success",
"errors": null,
"data": {
"id": 4,
"title": "Daytona Running Club",
"photoUrl": "https://img.freepik.com/free-photo/young-happy-sportswoman-running-road-morning-copy-space_637285-3758.jpg",
"content": "Daytona Content"
}
}Endpoint : PATCH /api/clubs/{clubId}
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body:
{
"title" : "Daytona Running Club",
"content" : "Daytona Content",
"photoUrl" : "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}Response Body:
{
"status": true,
"messages": "Club update success",
"errors": null,
"data": {
"id": 4,
"title": "Daytona Running Club",
"photoUrl": "https://img.freepik.com/free-photo/young-happy-sportswoman-running-road-morning-copy-space_637285-3758.jpg",
"content": "Daytona Content"
}
}Endpoint : DELETE /api/clubs/{clubId}
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body: None
Response Body:
{
"status": true,
"messages": "Club delete success",
"errors": null,
"data": null
}Endpoint : GET /api/clubs
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
Request Body: None
Response Body:
{
"status": true,
"messages": "Club fetching success",
"errors": null,
"data": [
{
"id": 4,
"title": "Daytona Running Club",
"photoUrl": "Daytona Content",
"content": "https://img.freepik.com/free-photo/young-happy-sportswoman-running-road-morning-copy-space_637285-3758.jpg"
},
{
"id": 5,
"title": "Arizona Running Club",
"photoUrl": "Arizona Content",
"content": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}
]
}Endpoint : GET /api/clubs/list
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body: None
Response Body:
{
"status": true,
"messages": "Club fetching success",
"errors": null,
"data": [
{
"id": 7,
"title": "Boston Running Club",
"photoUrl": "Boston Content",
"content": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}
]
}Endpoint : POST /api/clubs/{clubId}/events
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body:
{
"clubId" : "7",
"name" : "Boston Running Club Event",
"startTime" : "10-02-2025",
"endTime" : "10-02-2025",
"type" : "Fun Run",
"photoUrl" : "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}Response Body:
{
"status": true,
"messages": "Event registration success",
"errors": null,
"data": {
"id": 1,
"name": "Boston Running Club Event",
"startTime": "10-02-2025",
"endTime": "10-02-2025",
"type": "Fun Run",
"photoUrl": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}
}Endpoint : GET /api/clubs/{clubId}
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body: None
Response Body:
{
"status": true,
"messages": "Event fetching success",
"errors": null,
"data": {
"id": 2,
"name": "Nevada Running Club Event",
"startTime": "11-02-2025",
"endTime": "11-02-2025",
"type": "Fun Run",
"photoUrl": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}
}Endpoint : PATCH /api/clubs/{clubId}/events/{eventId}
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body:
{
"clubId" : "8",
"eventId" : "2",
"name" : "Nevada Running Club Event",
"startTime" : "14-02-2025",
"endTime" : "14-02-2025",
"type" : "Fun Run on Desert",
"photoUrl" : "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}Response Body:
{
"status": true,
"messages": "Event update success",
"errors": null,
"data": {
"id": 2,
"name": "Nevada Running Club Event",
"startTime": "14-02-2025",
"endTime": "14-02-2025",
"type": "Fun Run on Desert",
"photoUrl": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}
}Endpoint : DELETE /api/clubs/{clubId}/events/{eventId}
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body: None
Response Body:
{
"status": true,
"messages": "Event delete success",
"errors": null,
"data": null
}Endpoint : GET /api/events/list
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
- ROLE_USER
Request Body: None
Response Body:
{
"status": true,
"messages": "Event fetching success",
"errors": null,
"data": [
{
"id": 1,
"name": "Boston Running Club Event",
"startTime": "10-02-2025",
"endTime": "10-02-2025",
"type": "Fun Run",
"photoUrl": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
},
{
"id": 3,
"name": "Nevada Running Club Event on Summer",
"startTime": "11-08-2025",
"endTime": "11-08-2025",
"type": "Fun Run Summer",
"photoUrl": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}
]
}Endpoint : GET /api/events
Request Header :
- Authorization : "Bearer " + Token (mandatory)
Allowed User :
- ROLE_ADMIN
Request Body: None
Response Body:
{
"status": true,
"messages": "Event fetching success",
"errors": null,
"data": [
{
"id": 1,
"name": "Boston Running Club Event",
"startTime": "10-02-2025",
"endTime": "10-02-2025",
"type": "Fun Run",
"photoUrl": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
},
{
"id": 3,
"name": "Nevada Running Club Event on Summer",
"startTime": "11-08-2025",
"endTime": "11-08-2025",
"type": "Fun Run Summer",
"photoUrl": "https://img.freepik.com/free-photo/young-attractive-fitness-girl-jogging_176420-824.jpg"
}
]
}