Request :
- Method : POST
- Endpoint :
/api/login
- Body :
{
"email": "string, unique",
"password": "string"
}
Response :
{
"message": {
"id": "integer, unique",
"name": "string",
"email": "string",
"address": "string",
"role": "string"
},
"token": "string"
}
Request :
- Method : POST
- Endpoint :
/api/register
- Body :
{
"name": "string",
"email": "string, unique",
"address": "string",
"password": "string"
}
Response :
{
{
"data": {
"email": "string",
"name": "string",
"address": "string"
},
"token": "string",
"message": "Registration Success"
}
}
Request :
- Method : GET
- Endpoint guest:
/api/communities
- Endpoint admin:
/api/v1/communities
- Endpoint admin:
/api/v2/communities
Response :
{
"success": "boolean",
"message": "SUCCESS",
"communityData": [
{
"id": "integer",
"name": "string",
"location": "string",
"postal_code": "string",
"image": "string",
"leader_id": "integer",
"leader_name": "string"
},
{
"id": "integer",
"name": "string",
"location": "string",
"postal_code": "string",
"image": "string",
"leader_id": "integer",
"leader_name": "string"
}
]
}
Request :
- Method : GET
- Endpoint guest:
/api/communities/{id}
- Endpoint admin:
/api/v1/communities/{id}
- Endpoint admin:
/api/v2/communities/{id}
Response :
{
"success": "boolean",
"status": "string",
"message": "string",
"communityDetail": {
"id": "integer",
"name": "string",
"location": "string",
"postal_code": "string",
"image": "string",
"description": "text"
},
"communityActivities": [
{
"title": "string",
"description": "string",
"date": "date",
"status": "string"
}
],
"communityLeader": {
"id": "integer",
"name": "string"
}
}
Request :
-
Method : POST
-
Endpoint admin:
/api/v1/communities
-
Endpoint user:
/api/v2/communities
-
Header Authorization: Bearer token
-
Body :
{
"name": "string",
"leader_id": "integer",
"location": "string",
"postal_code": "string",
"image": "string",
"description": "text"
}
Response :
{
"success": "boolean",
"status": "string",
"message": "string",
"communityDetail": {
"id": "integer",
"name": "string",
"location": "string",
"postal_code": "string",
"image": "string",
"description": "text"
},
"communityActivities": [
{
"title": "string",
"description": "string",
"date": "date",
"status": "string"
}
],
"communityLeader": {
"id": "integer",
"name": "string"
}
}
Request :
-
Method : PATCH
-
Endpoint admin:
/api/v1/communities/{id}
-
Endpoint user:
/api/v2/communities/{id}
-
Header Authorization: Bearer token
-
Body :
{
"name": "string",
"leader_id": "integer",
"location": "string",
"postal_code": "string",
"image": "string",
"description": "text"
}
Response :
{
"success": "boolean",
"status": "string",
"message": "string",
"data": {
"id": "integer",
"name": "string",
"location": "string",
"description": "text",
"leader_id": "integer",
"image": "string",
"postal_code": "string",
"createdAt": "date",
"updatedAt": "date"
}
}
Request :
- Method : DELETE
- Endpoint:
/api/v1/communities/{id}
- Header Authorization: Bearer token
Response :
{
"status": "boolean",
"message": "string"
}
Request :
- Method : GET
- Endpoint admin:
/api/v1/communities/{id}/community-members
- Endpoint user:
/api/v2/communities/{id}/community-members
- Header Authorization: Bearer token
Response :
{
"success": boolean,
"message": "string",
"communityMembers": [
{
"id": integer,
"name": "string",
"address": "string",
"email": "string",
"users_id": integer
},
{
"id": integer,
"name": "string",
"address": "string",
"email": "string",
"users_id": integer
}
]
}
Request :
-
Method : POST
-
Endpoint admin:
/api/v1/communities/{id}/community-members
-
Endpoint user:
/api/v2/communities/{id}/community-members
-
Header Authorization: Bearer token
-
Body
{
"users_id": "integer",
"community_role": "string"
}
Response :
{
"success": "boolean",
"message": "string",
"data": {
"id": "integer",
"users_id": "integer",
"communities_id": "integer",
"community_role": "string",
"updatedAt": "2023-06-14T19:34:19.693Z",
"createdAt": "2023-06-14T19:34:19.693Z"
}
}
Request :
- Method : DELETE
- Endpoint admin:
/api/v1/communities/{communityId}/community-members/{memberId}
- Header Authorization: Bearer token
Response :
{
"status": "string",
"message": "string"
}
Request :
- Method : POST
- Endpoint:
/api/v2/communities/{communityId}/activity
- Header Authorization: Bearer token -Body:
{
"title": "string ",
"description": " text",
"date": "date",
"status": "string"
}
Response :
{
"status": "string",
"message": "string",
"data": {
"id": "integer",
"communities_id": "integer",
"title": "string",
"date": "date",
"description": " text",
"status": "string",
"updatedAt": "date",
"createdAt": "date"
}
}
Request :
- Method : PATCH
- Endpoint:
/api/v2/communities/{communityId}/activity/{activityId}
- Header Authorization: Bearer token -Body:
{
"title": "string",
"description": " text",
"date": "date",
"status": "string"
}
Response :
{
"success": "boolean",
"status": "string",
"message": "string",
"data": {
"id": "integer",
"communities_id": "integer",
"title": "string",
"description": " text",
"date": "date",
"status": "string",
"createdAt": "date",
"updatedAt": "date"
}
}
Request :
- Method : DELETE
- Endpoint:
/api/v2/communities/{communityId}/activity/{activityId}
- Header Authorization: Bearer token
Response :
{
"status": "string",
"message": "string"
}