This is an API for interaction between client side app and database of sarvsahayak app. Input output is done in JSON format.
Variable used:
{{url}} : https://sarvsahayakapi.herokuapp.com
Note: For type of fields visit User router and Complaint router
url: {{url}}/users
method: POST
required fields:
1. name
2. email
3. password
4. mobileNo
optional fields:
1. avatar
url: {{url}}/users/login
method: POST
required fields:
1. email
2. password
url: {{url}}/users/logout
method: POST
required fields: no need
url: {{url}}/users/logoutAll
method: POST
required fields: no need
url: {{url}}/complaints
method: POST
required fields:
1. description
2. category
3. address
4. lat
5. long
optional fields:
1. status (default: 0)
url: {{url}}/users/me
method: GET
url: {{url}}/complaints
method: GET
query params:
1. status
eg-> ?status=0
2. sortBy
eg-> ?sortBy:category=desc
3. limit
eg-> ?limit=3
4. skip
eg-> ?skip=4
url: {{url}}/complaints/:id
method: GET
url: {{url}}/users/me
method: PATCH
allowed fields:
1. password
2. mobileNo
optional fields:
1. avatar
url: {{url}}/complaints/:id
method: PATCH
allowed fields:
1. description
2. status
url: {{url}}/users/me
method: DELETE
url: {{url}}/complaints/:id
method: DELETE
url: {{url}}/users/me/avatar
method: POST
required fields:
1. avatar
url: {{url}}/users/me/avatar
method: DELETE
url: {{url}}/users/:id/avatar
method: GET
Note: For type of fields visit Client router and Complaint router
url: {{url}}/ngos
method: POST
required fields:
1. name
2. email
3. password
4. mobileNo
5. categories
6. lat
7. long
optional fields:
1. avatar
url: {{url}}/ngos/login
method: POST
required fields:
1. email
2. password
url: {{url}}/ngos/logout
method: POST
required fields: no need
url: {{url}}/ngos/logoutAll
method: POST
required fields: no need
url: {{url}}/ngos/complaints
method: GET
query params:
1. status
eg-> ?status=0
2. sortBy
eg-> ?sortBy:category=desc
3. limit
eg-> ?limit=3
4. skip
eg-> ?skip=4
url: {{url}}/ngos/me
method: PATCH
allowed fields:
1. password
2. mobileNo
optional fields:
1. avatar
url: {{url}}/ngos/complaints/:id
method: PATCH
allowed fields:
1. status
url: {{url}}/ngos/me
method: DELETE
url: {{url}}/ngos/me/avatar
method: POST
required fields:
1. avatar
url: {{url}}/ngos/me/avatar
method: DELETE
url: {{url}}/ngos/:id/avatar
method: GET