attribute | description | type | example |
---|---|---|---|
id | Gym ID | Integer | 1 |
name | Name of gym | String | The Hive Bouldering Gym |
address | Address of gym | String | 520 Industrial Ave, Vancouver, BC, V6A 2P3 |
city | City of Gym | String | Vancouver |
This method returns the data for a single gym.
GET /gym/:id
Code | description |
---|---|
200 | Successfully listed gym |
400 | Error occurred |
404 | Id not found |
curl -X GET http://localhost:3001/gym/1
{
"data": [
{
"id": 1,
"name": "The Hive Bouldering Gym",
"address": "520 Industrial Ave, Vancouver, BC, V6A 2P3",
"city": "Vancouver"
}
]
}
This method returns all gyms
GET /gym
Code | description |
---|---|
200 | Successfully listed gyms |
400 | Error occurred |
curl -X GET http://localhost:3001/gym
{
"data": [
{
"id": 1,
"name": "The Hive Bouldering Gym",
"address": "520 Industrial Ave, Vancouver, BC, V6A 2P3",
"city": "Vancouver"
},
{
"id": 2,
"name": "The Hive Surrey Climbing and Fitness",
"address": "101 – B 11125 124 Street, Surrey, BC, V3V 4",
"city": "Surrey"
},
{
"id": 3,
"name": "The Hive PoCo",
"address": "Unit 145, 815 Village Drive, Port Coquitlam, ",
"city": "Port Coquitlam"
},
{
"id": 4,
"name": "The Hive North Shore Climbing and Fitness",
"address": "140 – 2270 Dollarton Hwy, North Vancouver, BC",
"city": "North Vancouver"
}
]
}
This method returns all gyms from an encoded URI SQL query
GET /gym/query/:query
Code | description |
---|---|
200 | Successfully listed gyms |
400 | Error occurred |
curl -X GET http://localhost:3001/gym/query/%7B%22select%22%3A%5B%22id%22%2C%22name%22%2C%22address%22%2C%22city%22%5D%2C%22where%22%3A%22%22%2C%22orderby%22%3A%5B%7B%22id%22%3A%22DESC%22%7D%5D%2C%22limit%22%3A%222%22%7D
{
"data": [
{
"id": 4,
"name": "The Hive North Shore Climbing and Fitness",
"address": "140 – 2270 Dollarton Hwy, North Vancouver, BC",
"city": "North Vancouver"
},
{
"id": 3,
"name": "The Hive PoCo",
"address": "Unit 145, 815 Village Drive, Port Coquitlam, ",
"city": "Port Coquitlam"
}
]
}
This method adds a gym
POST /gym
Code | description |
---|---|
200 | Successfully add gym |
400 | Error occurred |
curl -d '{ "name": "New Gym", "address": "123 Test Street", "city": "Climbington" }' -H "Content-Type: application/json" -X POST http://localhost:3001/gym
{
"data": [
{
"id": 21
}
]
}
This method adds a gym
PUT /gym/:id
Code | description |
---|---|
200 | Successfully updated gym |
202 | No data updated |
400 | Error occurred |
404 | Id not found |
curl -d '{ "name": "New Gym 2", "address": "123 Test Street", "city": "Climbington" }' -H "Content-Type: application/json" -X PUT http://localhost:3001/gym/21
{
"data": [
{
"id": 21
}
]
}
This method deletes a gym
DELETE /gym/:id
Code | description |
---|---|
200 | Successfully deleted gym |
400 | Error occurred |
404 | Id not found |
curl -X DELETE http://localhost:3001/gym/21
{
"data": [
{
"id": 21
}
]
}
attribute | description | type | example |
---|---|---|---|
id | Location ID | Integer | 9 |
gymId | Gym ID | Integer | 2 |
name | Name of gym | String | Educational Wall |
This method returns the data for a single location.
GET /location/:id
Code | description |
---|---|
200 | Successfully listed location |
400 | Error occurred |
404 | Id not found |
curl -X GET http://localhost:3001/location/9
{
"data": [
{
"id": 9,
"gymId": 2,
"name": "Educational Wall"
}
]
}
This method returns all locations
GET /location
Code | description |
---|---|
200 | Successfully listed locations |
400 | Error occurred |
curl -X GET http://localhost:3001/location
{
"data": [
{
"id": 1,
"gymId": 1,
"name": "slab wall"
},
{
"id": 2,
"gymId": 2,
"name": "cavessss"
}
]
}
This method returns all locations from an encoded URI SQL query
GET /location/query/:query
Code | description |
---|---|
200 | Successfully listed locations |
400 | Error occurred |
curl -X GET http://localhost:3001/gym/query/%7B%22select%22%3A%5B%22id%22%2C%22gymId%22%2C%22name%22%5D%2C%22where%22%3A%22%22%2C%22orderby%22%3A%5B%7B%22id%22%3A%22DESC%22%7D%5D%2C%22limit%22%3A%222%22%7D
{
"data": [
{
"id": 11,
"gymId": 1,
"name": "test"
},
{
"id": 10,
"gymId": 2,
"name": "new location"
}
]
}
This method adds a location
POST /location
Code | description |
---|---|
200 | Successfully add location |
400 | Error occurred |
curl -d '{ "gymId": 1, "name": "New Location" }' -H "Content-Type: application/json" -X POST http://localhost:3001/location
{
"data": [
{
"id": 12
}
]
}
This method adds a location
PUT /location/:id
Code | description |
---|---|
200 | Successfully updated location |
202 | No data updated |
400 | Error occurred |
404 | Id not found |
curl -d '{ "gymId": 1, "name": "New Location Two" }' -H "Content-Type: application/json" -X PUT http://localhost:3001/location/12
{
"data": [
{
"id": "12"
}
]
}
This method deletes a location
DELETE /location/:id
Code | description |
---|---|
200 | Successfully deleted location |
400 | Error occurred |
404 | Id not found |
curl -X DELETE http://localhost:3001/location/12
{
"data": [
{
"id": 12
}
]
}
attribute | description | type | example |
---|---|---|---|
id | Boulder ID | Integer | 1 |
locationId | Location ID | Integer | 4 |
rating | Rating of boulder | Integer | 1 |
colour | Colour of boulder | String | Blue |
boulderType | Type of boulder | String | Slab |
description | Description of boulder | String | Very powerful moves |
setStartDate | Date the boulder was set | Date | 2023-10-07T07:00:00.000Z |
setEndDate | Date the boulder was removed | Date | 2023-10-07T07:00:00.000Z |
This method returns the data for a single boulder.
GET /boulder/:id
Code | description |
---|---|
200 | Successfully listed boulder |
400 | Error occurred |
404 | Id not found |
curl -X GET http://localhost:3001/boulder/15
{
"data": [
{
"id": 15,
"locationId": 14,
"rating": 5,
"colour": "Blue",
"boulderType": "Overhang",
"description": "Very tough start with complete horizontal for 5+ moves",
"setStartDate": "2023-10-07T07:00:00.000Z",
"setEndDate": "0000-00-00"
}
]
}
This method returns all boulders
GET /boulder
Code | description |
---|---|
200 | Successfully listed boulders |
400 | Error occurred |
curl -X GET http://localhost:3001/boulder
{
"data": [
{
"id": 11,
"locationId": 13,
"rating": 1,
"colour": "Yellow",
"boulderType": "Slab",
"description": "Nice and easy warmup",
"setStartDate": "2023-10-07T07:00:00.000Z",
"setEndDate": "0000-00-00"
},
{
"id": 12,
"locationId": 13,
"rating": 2,
"colour": "Purple",
"boulderType": "Slab",
"description": "Interesting grape-like holds",
"setStartDate": "2023-10-07T07:00:00.000Z",
"setEndDate": "0000-00-00"
}
]
}
This method returns all boulders from an encoded URI SQL query
GET /boulder/query/:query
Code | description |
---|---|
200 | Successfully listed boulders |
400 | Error occurred |
curl -X GET http://localhost:3001/boulder/query/%7B%22select%22%3A%5B%22id%22%2C%22rating%22%2C%22colour%22%2C%22description%22%5D%2C%22where%22%3A%22%22%2C%22orderby%22%3A%5B%7B%22id%22%3A%22DESC%22%7D%5D%2C%22limit%22%3A%222%22%7D
{
"data": [
{
"id": 34,
"rating": -1,
"colour": "Black",
"description": ""
},
{
"id": 32,
"rating": 4,
"colour": "Black",
"description": "HARD"
}
]
}
This method adds a boulder
POST /boulder
Code | description |
---|---|
200 | Successfully add boulder |
400 | Error occurred |
curl -d '{ "locationId": 21, "rating": 1, "colour": "Green", "boulderType": "Overhang", "description": "Tough start", "setStartDate": "2023-10-11", "setEndDate": "2023-10-11" }' -H "Content-Type: application/json" -X POST http://localhost:3001/boulder
{
"data": [
{
"id": 37
}
]
}
This method adds a boulder
PUT /boulder/:id
Code | description |
---|---|
200 | Successfully updated boulder |
202 | No data updated |
400 | Error occurred |
404 | Id not found |
curl -d '{ "locationId": 21, "rating": 6, "colour": "Blue", "boulderType": "Slab", "description": "Tough start", "setStartDate": "2023-10-11", "setEndDate": "2023-10-11" }' -H "Content-Type: application/json" -X PUT http://localhost:3001/boulder/37
{
"data": [
{
"id": "37"
}
]
}
This method deletes a boulder
DELETE /boulder/:id
Code | description |
---|---|
200 | Successfully deleted boulder |
400 | Error occurred |
404 | Id not found |
curl -X DELETE http://localhost:3001/boulder/37
{
"data": [
{
"id": "37"
}
]
}
attribute | description | type | example |
---|---|---|---|
id | Climb ID | Integer | 200 |
boulderID | Boulder ID | Integer | 3 |
sessionId | Session ID | Integer | 15 |
attempts | # of attempts | Integer | 4 |
sends | # of sends | Integer | 1 |
climbStartTime | Datetime the climb was started | DateTime | 2023-02-12T08:00:00.000Z |
climbEndTime | Datetime the climb ended | DateTime | 2023-02-12T08:00:00.000Z |
This method returns the data for a single climb.
GET /climb/:id
Code | description |
---|---|
200 | Successfully listed climb |
400 | Error occurred |
404 | Id not found |
curl -X GET http://localhost:3001/climb/200
{
"data": [
{
"id": 200,
"boulderId": 0,
"sessionId": 0,
"attempts": 2,
"sends": 1,
"climbStartTime": "2023-02-12T08:00:00.000Z",
"climbEndTime": "2023-02-12T08:00:00.000Z"
}
]
}
This method returns all climbs
GET /climb
Code | description |
---|---|
200 | Successfully listed climbs |
400 | Error occurred |
curl -X GET http://localhost:3001/climb
{
"data": [
{
"id": 200,
"boulderId": 0,
"sessionId": 0,
"attempts": 2,
"sends": 1,
"climbStartTime": "2023-02-12T08:00:00.000Z",
"climbEndTime": "2023-02-12T08:00:00.000Z"
},
{
"id": 201,
"boulderId": 0,
"sessionId": 1,
"attempts": 4,
"sends": 0,
"climbStartTime": "2023-02-12T08:00:00.000Z",
"climbEndTime": "2023-02-12T08:00:00.000Z"
},
{
"id": 202,
"boulderId": 1,
"sessionId": 1,
"attempts": 10,
"sends": 4,
"climbStartTime": "2023-02-12T08:00:00.000Z",
"climbEndTime": "2023-02-12T08:00:00.000Z"
}
]
}
This method returns all climbs from an encoded URI SQL query
GET /climb/query/:query
Code | description |
---|---|
200 | Successfully listed climbs |
400 | Error occurred |
curl -X GET http://localhost:3001/climb/query/%7B%22select%22%3A%5B%22id%22%2C%22boulderId%22%2C%22sessionId%22%2C%22attempts%22%2C%22sends%22%2C%22climbStartTime%22%2C%22climbEndTime%22%5D%2C%22where%22%3A%22%22%2C%22orderby%22%3A%5B%7B%22id%22%3A%22DESC%22%7D%5D%2C%22limit%22%3A%222%22%7D
{
"data": [
{
"id": 27,
"boulderId": 1,
"sessionId": 2,
"attempts": 1,
"sends": 4,
"climbStartTime": "0000-00-00 00:00:00",
"climbEndTime": "2023-08-01T09:41:00.000Z"
},
{
"id": 26,
"boulderId": 1,
"sessionId": 2,
"attempts": 1,
"sends": 4,
"climbStartTime": "0000-00-00 00:00:00",
"climbEndTime": "2023-08-01T09:41:00.000Z"
}
]
}
This method adds a climb
POST /climb
Code | description |
---|---|
200 | Successfully add climb |
400 | Error occurred |
curl -d '{ "boulderId": 1, "sessionId": 2, "attempts": 1, "sends": 5, "climbStartTime": "2023-08-01T02:40:00.000Z", "climbEndTime": "2023-08-01T02:41:00.000Z" }' -H "Content-Type: application/json" -X POST http://localhost:3001/climb
{
"data": [
{
"id": 18
}
]
}
This method adds a climb
PUT /climb/:id
Code | description |
---|---|
200 | Successfully updated climb |
202 | No data updated |
400 | Error occurred |
404 | Id not found |
curl -d '{ "boulderId": 1, "sessionId": 2, "attempts": 1, "sends": 5, "climbStartTime": "2023-08-01T02:40:00.000Z", "climbEndTime": "2023-08-01T02:41:00.000Z" }' -H "Content-Type: application/json" -X PUT http://localhost:3001/climb/18
{
"data": [
{
"id": 18
}
]
}
This method deletes a climb
DELETE /climb/:id
Code | description |
---|---|
200 | Successfully deleted climb |
400 | Error occurred |
404 | Id not found |
curl -X DELETE http://localhost:3001/climb/3
{
"data": [
{
"id": 3
}
]
}
TODO
GET /user
TODO
POST /user/:username/:password
TODO
PUT /user/:username/:password
TODO
Delete /user/:username/:password
TODO
POST /user/:username/:password/signin