Skip to content

Academies

Get all Academies

You can access the list of 10 Academy by using the /academys endpoint.

Request:

[GET] https://jiujitero-api.onrender.com/api/v1/academys

Response:

[
{
"_id": "65fa95f40e9d93d0fb93243d",
"name": "10th planet jiu-jitsu",
"location": "Los Angeles, California",
"professor": "Eddie Bravo",
"phone": 080055512345
},
// ...
]

Get a single academy

You can get a single academy by adding the id as a parameter: /academys/{id}

Request:

Terminal window
[GET] https://jiujitero-api.onrender.com/api/v1/academys/65fa95f40e9d93d0fb93243d

Response:

{
"_id": "65fa95f40e9d93d0fb93243d",
"name": "10th planet jiu-jitsu",
"location": "Los Angeles, California",
"professor": "Eddie Bravo",
"phone": 080055512345
}

Create a academy

You can create a new academy by sending an object like the following to /academys/

Request:

Terminal window
[POST] https://jiujitero-api.onrender.com/api/v1/academys/
# Body
{
"name": "New Academy",
"location": "Place where academy is located",
"professor": "Professor name",
"phone": 1234000555,
"image": "https://www.jjimageexample.com.jpeg"
}

Response:

{
"_id": "87fa95f40e9d93d0fb55466c",
"name": "New Academy",
"location": "Place where academy is located",
"professor": "Professor name",
"phone": 1234000555,
"image": "https://www.jjimageexample.com.jpeg"
}

Note that the image is an URLs that must be ending in a valid image extencion.

Update a academy

You can update an existing academy by sending an object like the following and adding the id as a parameter: /academys/{id}

Request:

Terminal window
[PATCH] https://jiujitero-api.onrender.com/api/v1/academys/87fa95f40e9d93d0fb55466c
# Body
{
"name": "Change title"
}

Response:

{
"_id": "87fa95f40e9d93d0fb5466c",
"name": "Change title",
"location": "Place where academy is located",
"professor": "Professor name",
"phone": 1234000555
}

Note that it is not necessary to send all the academy attributes, just send the attributes that want to update.

Delete a academy

You can delete an existing academy by adding the id as a parameter: /academia/{id}

Request:

Terminal window
[DELETE] https://jiujitero-api.onrender.com/api/v1/academys/87fa95f40e9d93d0fb55466c

Response:

Terminal window
'Academy with id 87fa95f40e9d93d0fb55466c its been deteled'

Get all Athletes by Academy

No information completed yet

You can get all athletes by Academy adding the academyID as a parameter to /academys/{academyID}/athletes

Request:

[GET] https://jiujitero-api.onrender.com/api/v1/academys/65fa95f40e9d93d0fb932435/athletes

Response:

[
{
"info": {},
}
// ...
]

Schema Academy

AttributeTypeDescription
idstringThe id of the academy
namestringName of the academy
locaionstringThe place where is located
professorstringFounder or who teach at in place
phonenumbernumber for phone comunication