-
Notifications
You must be signed in to change notification settings - Fork 10
Example API documentation
Returns all patients without any parameter.
http://34.208.111.47:8080/hospital/patient/
GET http://127.0.0.1:8000/hospital/patient/
{"patients": [{"name": "qwer", "lastname": "qwerty", "age": 34}, {"name": "rttyu", "lastname": "qwe", "age": 45}, {"name": "kkkkkk", "lastname": "llllll", "age": 34}]}
Creates a patient with new id.
POST /hospital/patient/
http://34.208.111.47:8080/hospital/patient/
On success, the HTTP status code in the response header is 200
OK and the response
body contains a patient object in JSON format. On error, the header status code is
an error code and the response body contains the following JSON object:
{"status":"FAIL", "message":"wrong data format"}
request: $ curl -X POST 34.208.111.47:8080/hospital/patient/ -d '{"name": "Kerem", "lastname": "Kolsuz", "age": 25},'
response:
{
"status":"OK", "message":""
}
Get information about a single patient.
PATH PARAMETER | VALUE |
---|---|
id | The id for the patient. |
http://34.208.111.47:8080/hospital/patient/{id}
request: $ curl -X GET 127.0.0.1:8000/hospital/patient/1/
{"name": "qwer", "lastname": "qwerty", "age": 34}'
Modify an existing patient, in particular change its fields such as name, age or lastname.
PATH PARAMETER | VALUE |
---|---|
id | The id for the patient. |
http://34.208.111.47:8080/hospital/patient/{id}
$ curl -X PUT 34.208.111.47:8080/hospital/patient/1/ -d '{"name": "Firat", "lastname":"Tekin", "Age":30 }'
{"status": "OK", "message": ""}'
Deletes existing patient via given id.
DELETE /hospital/patient/{id}
PATH PARAMETER | VALUE |
---|---|
id | The id for the patient. |
http://34.208.111.47:8080/hospital/patient/{id}
On success, the HTTP status code in the response header is 200
OK and the response
body contains a patient object in JSON format. On error, the header status code is
an error code and the response body contains the following JSON object:
{"status":"FAIL", "message":"patient does not exist"}
request: $ curl -X DELETE 34.208.111.47:8080/hospital/patient_single/1/ -d '{"name": "rttyu"}'
response:
{
"status":"OK", "message":""
}
Returns all doctors without any parameter.
http://34.208.111.47:8080/hospital/doctor/
GET http://127.0.0.1:8000/hospital/doctor/
` {"doctors": [{"name": "Deniz", "lastname": "Tekin", "age": 34}, {"name": "Sami", "lastname": "Ozan", "age": 45}, {"name": "Yasemin", "lastname": "Olsun", "age": 29}]}
Creates a doctorwith new id.
POST /hospital/doctor/
http://34.208.111.47:8080/hospital/doctor/
On success, the HTTP status code in the response header is 200
OK and the response
body contains the following:
{
"status":"OK", "message":""
}
On error, the header status code is an error code and the response body contains the following JSON object:
{
"status": "FAIL",
"message": "wrong data format"
}
request: $ curl -X POST 34.208.111.47:8080/hospital/doctor/ -d '{"name": "Ahmet", "lastname": "Mehmet", "age": 46},'
response:
{
"status":"OK", "message":""
}
Get information for a single doctor.
PATH PARAMETER | VALUE |
---|---|
id | The id for the doctor. |
http://34.208.111.47:8080/hospital/doctor/{id}
request: $ curl -X GET 34.208.111.47:8080/hospital/doctor/1/
{"name": "Deniz", "lastname": "Yilmaz", "age": 38}'
Modify an existing doctor, in particular change its fields such as name, age.
PATH PARAMETER | VALUE |
---|---|
id | The id for the department. |
http://34.208.111.47:8080/hospital/doctor/{id}
$ curl -X PUT 34.208.111.47:8080/hospital/doctor/1/ -d '{"name": "Firat", "lastname":"Tekin", "Age":30 }'
{"status": "OK", "message": ""}'
Deletes a doctor in given id.
DELETE /hospital/doctor/{id}
PATH PARAMETER | VALUE |
---|---|
id | The id for the doctor. |
http://34.208.111.47:8080/hospital/doctor/{id}
On success, the HTTP status code in the response header is 200
OK and the response
body contains a doctor object in JSON format. On error, the header status code is
an error code and the response body contains the following JSON object:
{"status":"FAIL", "message":"doctor does not exist"}
request: $ curl -X DELETE 34.208.111.47:8080/hospital/doctor_single/1/ -d '{"name": "Deniz Yılmaz"}'
response:
{
"status":"OK", "message":""
}
Returns departments without any parameter.
http://34.208.111.47:8080/hospital/department/
GET http://127.0.0.1:8000/hospital/department/
{"departments": [{"name": "Goz"}, {"name": "Kulak"}, {"name": "Kardiyoloji"}]}
Get information for a single department.
GET /hospital/department/{id}
PATH PARAMETER | VALUE |
---|---|
id | The id for the department. |
On success, the HTTP status code in the response header is 200
OK and the response
body contains a department object in JSON format. On error, the header status code is
an error code and the response body contains the following JSON object:
{"status":"FAIL", "message":"department does not exist"}
request: $ curl -X GET 127.0.0.1:8000/hospital/department/1/
response:
{
"name": "Kulak Burun Bogaz"
}
Modify an existing department, in particular change its name.
PUT /hospital/department/{id}
PATH PARAMETER | VALUE |
---|---|
id | The id for the department. |
QUERY PARAMETER | VALUE |
---|---|
name | The new name for the existing department |
On success, the HTTP status code in the response header is 200
OK and the response
body contains a department object in JSON format. On error, the header status code is
an error code and the response body contains the following JSON object:
{"status":"FAIL", "message":"department does not exist"}
request: $ curl -X PUT 34.208.111.47:8080/hospital/department/1/ -d '{"name": "Kulak Burun Bogaz"}'
response:
{
"status":"OK", "message":""
}
Deletes a department in given id.
DELETE /hospital/department/{id}
PATH PARAMETER | VALUE |
---|---|
id | The id for the department. |
http://34.208.111.47:8080/hospital/department/{id}
On success, the HTTP status code in the response header is 200
OK and the response
body contains a department object in JSON format. On error, the header status code is
an error code and the response body contains the following JSON object:
{"status":"FAIL", "message":"department does not exist"}
$ curl -X DELETE 34.208.111.47:8080/hospital/doctor/3/ -d '{"name": "Dahiliye"}'
response:
{
"status":"OK", "message":""
}
Returns all rendezvous without any parameter.
http://34.208.111.47:8080/hospital/rendezvous/
GET http://127.0.0.1:8000/hospital/rendezvous/
` {"rendezvous": [{"Patient name and lastname": "qwer qwerty", "time": "2017-04-23T22:07:39.117Z", "Doctor name and lastname": "Kazim Kazim"}, {"Patient name and lastname": "kkkkkk llllll", "time": "2017-04-23T23:06:05.880Z", "Doctor name and lastname": "Deniz Yilmaz"}, {"Patient name and lastname": "kkkkkk llllll", "time": "2017-04-23T23:07:27.308Z", "Doctor name and lastname": "qwert qwerty"}, {"Patient name and lastname": "qwer qwerty", "time": "2017-05-08T21:49:24.362Z", "Doctor name and lastname": "Deniz Yilmaz"}, {"Patient name and lastname": "qwer qwerty", "time": "2017-05-08T21:50:57.062Z", "Doctor name and lastname": "Deniz Yilmaz"}]}
Post rendezvous information and send a rendezvous to the database
QUERY PARAMETER | VALUE |
---|---|
doctor_id | The id of relevant doctor |
patient_id | The id of relevant patient |
http://34.208.111.47:8080/hospital/rendezvous
POST http://34.208.111.47:8080/hospital/rendezvous
{"status": "OK", "message": "rendezvous added"}
Returns single rendezvous without any parameter.
http://34.208.111.47:8080/hospital/rendezvous/{id}
GET http://34.208.111.47:8080/hospital/rendezvous/{id}
{"Time": "2017-04-23 22:07:39.117858+00:00", "Patient": "qwer qwerty", "Doctor Name": "Kazim Kazim"}
Deletes a rendezvous in given id.
DELETE /hospital/rendezvous/{id}
PATH PARAMETER | VALUE |
---|---|
id | The id for the rendezvous. |
http://34.208.111.47:8080/hospital/rendezvous/{id}
On success, the HTTP status code in the response header is 200
OK and the response
body contains a rendezvous object in JSON format. On error, the header status code is
an error code and the response body contains the following JSON object:
{ "message": "rendezvous does not exist", "status": "FAIL" }
request: $ curl -X DELETE 34.208.111.47:8080/hospital/rendezvous_single/1/
response:
{
"status":"OK", "message":""
}
Returns all patients without any parameter.
http://127.0.0.1:8000/hospital/patient/
GET http://127.0.0.1:8000/hospital/patient/
{"patients": [{"name": "qwer", "lastname": "qwerty", "age": 34}, {"name": "rttyu", "lastname": "qwe", "age": 45}, {"name": "kkkkkk", "lastname": "llllll", "age": 34}]}
Deletes a doctor in given id.
DELETE /hospital/doctor/{id}
PATH PARAMETER | VALUE |
---|---|
id | The id for the doctor. |
On success, the HTTP status code in the response header is 200
OK and the response
body contains a doctor object in JSON format. On error, the header status code is
an error code and the response body contains the following JSON object:
{"status":"FAIL", "message":"doctor does not exist"}
request: $ curl -X DELETE 34.208.111.47:8080/hospital/doctor_single/1/ -d '{"name": "Deniz Yılmaz"}'
response:
{
"status":"OK", "message":""
}
Home
API Research
API Documentation
Project Requirements
Mockups
Use Case Diagram and Scenarios
Questions to Be Asked to the Customer
Milestones
Meeting Notes (352)
- Meeting Note #1
- Meeting Note #2
- Meeting Note #3
- Meeting Note #4
- Meeting Note #5
- Meeting Note #6
- Meeting Note #7
- Meeting Note #8
- Meeting Note #9
- Meeting Note #10
Meeting Notes (451)
Testing
Project Plan
Communication Plan
Members