Please join the postman workspace to make life easy for you.
Set the environment to Development
.
I will put the API endpoints and their documentations in this README. API test data is available in postman.
API Endpoint: https://donation-app-backend.cyclic.app/api
Token is signed using user's id (_id) and role (role).
Endpoint: /auth/signup
Method: POST
Datapoints:
Property | Type | Required | Unique | Description |
---|---|---|---|---|
firstName | String | required | ||
lastName | String | |||
String | required | unique | ||
phoneNo | String | |||
address | String | |||
city | String | ['rajkot', 'ahmedabad', 'surat', 'vadodara', 'bhavnagar'] | ||
profilePic | String | |||
gender | String | required | ['male', 'female', 'other'] | |
language | String | required | ['english', 'hindi', 'gujarati'] | |
password | String |
Endpoint: /auth/login
Method: POST
Datapoints:
Property | Type | Required |
---|---|---|
String | required | |
password | String | required |
Endpoint: /auth/forgot-password
https://donation-app-backend.cyclic.app/api/auth/forgot-password
Method: POST
Datapoints:
Property | Type | Required |
---|---|---|
String | required |
Endpoint: /auth/reset-password
https://donation-app-backend.cyclic.app/api/auth/reset-password
Method: POST
Datapoints:
Property | Type | Required |
---|---|---|
password | String | required |
token | String | required |
Endpoint: /user/donation/create
https://donation-app-backend.cyclic.app/api/user/donation/create
Method: POST
Datapoints:
Property | Type | Required | Description |
---|---|---|---|
donor_id | ObjectId | required | |
categories | String[] | required | ['book', 'cloths', 'book', 'other'] |
description | String | required | |
quantity | Number | required | |
city | String | required | ['rajkot', 'ahmedabad', 'surat', 'vadodara', 'bhavnagar'] |
pickupDetails | String | required | |
images | File[] | To be passed as files. Will be uploaded to s3 and keys will be stored in String[] |
Endpoint: /user/donation/:id
https://donation-app-backend.cyclic.app/api/user/donation/:id
Method: put
Datapoints:
Property | Type | Required | Description |
---|---|---|---|
categories | String[] | ['book', 'cloths', 'book', 'other'] | |
description | String | ||
quantity | Number | ||
city | String | ['rajkot', 'ahmedabad', 'surat', 'vadodara', 'bhavnagar'] | |
pickupDetails | String | ||
images | String[] |
Endpoint: /user/donation/all
https://donation-app-backend.cyclic.app/api/user/donation/all
Method: GET
Endpoint: /user/donation/:id
https://donation-app-backend.cyclic.app/api/user/donation/:id
Method: GET
Endpoint: /user/donation/user/:id
https://donation-app-backend.cyclic.app/api/user/donation/user/:id
Method: GET
Endpoint: /user/donation/city/:city
https://donation-app-backend.cyclic.app/api/user/donation/city/:city
Method: GET
Endpoint: /user/donation/:id
https://donation-app-backend.cyclic.app/api/user/donation/:id
Method: DELETE
Endpoint: /user/request/create
https://donation-app-backend.cyclic.app/api/user/request/create
Method: POST
Datapoints:
Property | Type | Required | Description |
---|---|---|---|
beneficiary_id | ObjectId | required | |
categories | String[] | required | ['book', 'cloths', 'book', 'other'] |
description | String | required | |
quantity | Number | required | |
city | String | required | ['rajkot', 'ahmedabad', 'surat', 'vadodara', 'bhavnagar'] |
pickupDetails | String | required | |
images | File[] | To be passed as files. Will be uploaded to s3 and keys will be stored in String[] |
Endpoint: /user/request/:id
https://donation-app-backend.cyclic.app/api/user/request/:id
Method: put
Datapoints:
Property | Type | Required | Description |
---|---|---|---|
categories | String[] | ['book', 'cloths', 'book', 'other'] | |
description | String | ||
quantity | Number | ||
city | String | ['rajkot', 'ahmedabad', 'surat', 'vadodara', 'bhavnagar'] | |
pickupDetails | String | ||
images | String[] |
Endpoint: /user/request/all
https://donation-app-backend.cyclic.app/api/user/request/all
Method: GET
Endpoint: /user/request/:id
https://donation-app-backend.cyclic.app/api/user/request/:id
Method: GET
Endpoint: /user/request/user/:id
https://donation-app-backend.cyclic.app/api/user/request/user/:id
Method: GET
Endpoint: /user/request/city/:city
https://donation-app-backend.cyclic.app/api/user/request/city/:city
Method: GET
Endpoint: /user/request/:id
https://donation-app-backend.cyclic.app/api/user/request/:id
Method: DELETE