Admin API
Table of Contents
GET : get report by query
- Get bug & content reports by query
URL
/api/admin/reports
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
query |
user |
int |
- |
unique id of the author of the report |
query |
type |
int |
- |
one of - 0: bug report, 1: content report |
query |
status |
int |
- |
one of - 0: pending, 1: accepted |
Key |
Description |
status |
success |
data |
array of report rows |
GET : get report by id
- Get bug & content report by unique id
URL
/api/admin/reports/:id
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
param |
id |
int |
O |
unique id of report |
Key |
Description |
status |
success |
data |
the returned report object |
POST : create report
- Create a new bug / content report
URL
/api/admin/reports/upload
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
body |
authorId |
int |
O |
unique id of requesting user / report author |
body |
type |
int |
O |
one of - 0: bug report, 1: content report |
body |
content |
string |
O |
report contents |
body |
reviewId |
int |
- |
for content reports, the corresponding review id |
Key |
Description |
status |
success |
data |
the created report object |
DELETE : delete report
URL
/api/admin/reports/delete/:id
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
param |
id |
int |
O |
unique id of report |
Key |
Description |
status |
success |
data |
the deleted report object |
POST : handle report (by admin)
- set the report to
accepted
, and perform follow-up action.
- supported follow-up action is :
delete : delete the corresponding review
URL
/api/admin/reports/handle/:id
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
param |
id |
int |
O |
unique id of report |
body |
adminId |
int |
O |
unique id of the requesting user, which is an admin |
body |
action |
string |
O |
supported actions - "delete" : delete the corresponding review |
Key |
Description |
status |
success |
data |
the updated report object |
deleteRows |
if action = "delete" , then this will return all the deleted rows |
GET : get facility registration request by id
- Retrieve a facility registration request by its ID
URL
/api/admin/facility-requests/:id
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
param |
id |
int |
O |
unique ID of the facility registration request |
Key |
Description |
status |
success |
data |
the returned facility registration request object |
GET : get all facility registration requests
- Retrieve all facility registration requests
URL
/api/admin/facility-requests
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
query |
user |
int |
- |
unique ID of the user (optional) |
query |
status |
int |
- |
status of the request (optional) |
Key |
Description |
status |
success |
data |
array of facility registration request objects |
POST : accept facility registration request requested by specified id
- Accept a facility registration request by its ID
URL
/api/admin/facility-requests/:id/accept
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
param |
id |
int |
O |
unique ID of the request |
body |
adminId |
int |
O |
unique ID of the admin |
Key |
Description |
status |
success |
data |
the accepted facility registration request object |
POST : decline facility registration request requested by specified id
- Decline a facility registration request by its ID
URL
/api/admin/facility-requests/:id/decline
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
param |
id |
int |
O |
unique ID of the request |
body |
adminId |
int |
O |
unique ID of the admin |
Key |
Description |
status |
success |
data |
the declined facility registration request object |
DELETE : delete facility registration request of specified id
- Delete a facility registration request by its ID
URL
/api/admin/facility-requests/:id
- Content-Type:
application/json
Location |
Field Name |
Data Type |
Required |
Description |
param |
id |
int |
O |
unique ID of the request |
Key |
Description |
status |
success |
data |
the deleted facility registration request object |