- Search Keyword by _id
- Dashboard
- Donors API
- DonorTransaction API
- Participants API
- Events
- Blood
- User
- Event Submission
- Hospital
- Hospital Request
- GET an object (Donor, DonorTransaction, Event) -> Endpoint: api/search/{_id}
if id is invalid, return 404 Not Found error
return JSON
-
GET notification -> Endpoint: api/notification
[ { "date": "string", "eventSubmission": [ { "_id": "string", "eventId": "string", "idCardNumber": "string", "fullName": "string", "phone": "string", "email": "string", "address": "string", "gender": "string", "dob": "string", "latestDonationDate": "string", "dateSubmitted": "string" }, ], "event": [ { "_id": "string", "name": "string", "location": { "city": "string", "address": "string" }, "startDate": "string", "duration": int, "detail": "string", "image": null, "binaryImage": null, "participants": 0, "dateCreated": "string" } ] }, ]
-
GET list successful donors, expected JSON return: -> Endpoint: api/Donor/success
{ _id (CMND), name (donor name), dob : int -> string, gender, address, phone, email, blood: { name, type, } }
-
GET data of a donor, expected JSON return: -> Endpoint: api/Donor/{_id} (id of a donor)
{ _id (CMND), name (donor name), dob : int -> string, gender, address, phone, email, blood: { name, type, } }
-
GET list failure donors, expected JSON return: -> Endpoint: api/Donor/failure
[ { _id (CMND), name (donor name), dob : int -> string, gender, address, phone, email, blood: { name, type, } transaction: { _id, blood: { name, type }, eventDonated: { _id, name }, dateDonated: string, amount: int, status: int, rejectReason, donorId } }, ]
-
GET list donation of a donor, expected JSON return: -> Endpoint: api/DonorTransaction/listDonation/{_id} (id of donor)
{ _id (CMND), name (donor name), dob : int -> string, gender, address, phone, email, blood: { name, type, } }
-
GET paticipants waiting for approved (Pending -> status: 0) -> Endpoint: api/Donor
[ { _id (CMND), name (donor name), dob : int -> string, gender, address, phone, email, blood: { name, type, } transaction: { _id, blood: { name, type }, eventDonated: { _id, name }, dateDonated: string, amount: int, status: int, rejectReason, donorId } }, ]
-
POST (import from excel) -> Endpoint: api/Donor
{ eventId: string, listParticipants: [ { _id: string (CMND), name, dob: string, gender, address, phone: string, email, transaction: { blood: { name, type }, dateDonated: string, amount: int } }, ] }
-
PUT participants waiting for approved -> Endpoint: api/DonorTransaction/approve
[ { _id, eventId }, ]
-
PUT participants waiting for rejected -> Endpoint: api/DonorTransaction/reject
[ { _id, eventId, rejectReason }, ]
- GET events data -> Endpoint: api/Event
{ _id, name, location: { city, address }, startDate: string, duration: int, detail, binaryImage: string (base64) }
- GET an event data -> Endpoint: api/Event/{_id}
{ _id, name, location: { city, address }, startDate: string, duration: int, detail, participants }
- GET an event data with query parameter -> Endpoint: api/Event/{_id}/?status=upcoming
- For checking the infomation of an upcoming Event
{ _id, name, location: { city, address }, startDate: string, duration: int, detail, participants }
-
POST events data -> Endpoint: api/Event
{ name, location: { city, address }, startDate: string, duration: int, detail, binaryImage: string (base64) }
-
DELETE events data -> Endpoint: api/Event/{_id}
Return true if delete success
-
GET list participants of an Event -> Endpoint: api/Event/listParticipants/{_id} (id of Event)
[ { _id (CMND), name (donor name), dob : int -> string, gender, address, phone, email, blood: { name, type, } transaction: { _id, blood: { name, type }, eventDonated: { _id, name }, dateDonated: string, amount: int, status: int, rejectReason, donorId } }, ]
- GET blood data -> Endpoint: api/Blood
{ _id, name, type, quantity: int }
-
POST user login -> Endpoint: api/user/login
{ "email": "string", "password": "string" }
Return token and user object when login success.
-
GET user from token -> Endpoint: api/user/verify
{ "_id": "string", "email": "string", "password": "string", "isAdmin": boolean, "hospital_id": "string" }
-
GET all user -> Endpoint: api/user
[ { "_id": "string", "email": "string", "password": "string", "isAdmin": boolean, "hospital_id": "string" } ]
-
GET user by id -> Endpoint: api/user/{id}
{ "_id": "string", "email": "string", "password": "string", "isAdmin": boolean, "hospital_id": "string" }
-
POST create user admin -> Endpoint: api/user
{ "email": "string" }
-
POST create user hospital -> Endpoint: api/user
{ "email": "string", "hospital_id": "string" }
-
DELETE user by id -> Endpoint: api/user/{id}
Return true if delete success
-
GET all event submission -> Endpoint: api/eventSubmission
[ { "_id": "string", "eventId": "string", "idCardNumber": "string", "fullName": "string", "phone": "string", "email": "string", "address": "string", "gender": "string", "dob": "string", "latestDonationDate": "string" } ]
-
GET event submission by id -> Endpoint: api/eventSubmission/{id}
{ "_id": "string", "eventId": "string", "idCardNumber": "string", "fullName": "string", "phone": "string", "email": "string", "address": "string", "gender": "string", "dob": "string", "latestDonationDate": "string" }
-
POST create event submission -> Endpoint: api/eventSubmission
{ "eventId": "string", "idCardNumber": "string", "fullName": "string", "phone": "string", "email": "string", "address": "string", "gender": "string", "dob": "string", "latestDonationDate": "string" }
-
DELETE event submission by id -> Endpoint: api/eventSubmission/{id}
Return true if delete success
-
GET all hospital -> Endpoint: api/hospital
[ { "_id": "string", "name": "string", "address": "string", "phone": "string" } ]
-
GET hospital by id -> Endpoint: api/hospital/{id}
{ "_id": "string", "name": "string", "address": "string", "phone": "string" "requestHistory" : [ { "_id": "string", "date": "string", "quantity": int, "blood": { "name": "string", "type": "string" }, "hospitalId": "string", "hospitalName": "string" "status": int, "rejectReason": "string" }, ] }
-
POST create hospital -> Endpoint: api/hospital
{ "name": "string", "address": "string", "phone": "string" }
-
PUT edit hospital -> Endpoint: api/hospital/{id}
{ "name": "string", "address": "string", "phone": "string" }
Return true if update success.
-
DELETE hospital by id -> Endpoint: api/hospital/{id}
Return true if delete success
-
GET all hospital request -> Endpoint: api/request
[ { "_id": "string", "date": "string", "quantity": int, "blood": { "name": "string", "type": "string" }, "hospitalId": "string", "hospitalName": "string" "status": int, "rejectReason": "string" } ]
-
GET hospital request by id -> Endpoint: api/request/{id}
{ "_id": "string", "date": "string", "quantity": int, "blood": { "name": "string", "type": "string" }, "hospitalId": "string", "hospitalName": "string", "status": int, "rejectReason": "string" }
-
POST create request -> Endpoint: api/request
{ "_id": "string", "date": "string", "quantity": int, "blood": { "name": "string", "type": "string" }, "hospitalId": "string" }
-
DELETE request by id -> Endpoint: api/request/{id}
Return true if delete success
-
PUT approve request -> Endpoint: api/request/approve
[ { "_id": "string" } ]
Return status 200 if success. Error will return 400 bad request status.
-
PUT reject request -> Endpoint: api/request/reject
[ { "_id": "string", "rejectReason": "string" } ]
Return status 200 if success. Error will return 400 bad request status.
-
GET pending request -> Endpoint: api/request/pendingRequest
[ { "_id": "string", "date": "string", "quantity": int, "blood": { "name": "string", "type": "string" }, "hospitalId": "string", "hospitalName": "string", "status": 0, "rejectReason": "string" } ]
Pending request "status": 0
-
GET approved request -> Endpoint: api/request/approvedRequest
[ { "_id": "string", "date": "string", "quantity": int, "blood": { "name": "string", "type": "string" }, "hospitalId": "string", "hospitalName": "string", "status": 1, "rejectReason": "string" } ]
Approved request "status": 1
-
GET rejected request -> Endpoint: api/request/rejectedRequest
[ { "_id": "string", "date": "string", "quantity": int, "blood": { "name": "string", "type": "string" }, "hospitalId": "string", "hospitalName": "string", "status": -1, "rejectReason": "string" } ]
Rected request "status": -1