FORK_backend_docs

Admin API

Table of Contents

GET : get report by query

URL

/api/admin/reports

Request Format

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

Response Format

Key Description
status success
data array of report rows

GET : get report by id

URL

/api/admin/reports/:id

Request Format

Location Field Name Data Type Required Description
param id int O unique id of report

Response Format

Key Description
status success
data the returned report object

POST : create report

URL

/api/admin/reports/upload

Request Format

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

Response Format

Key Description
status success
data the created report object

DELETE : delete report

URL

/api/admin/reports/delete/:id

Request Format

Location Field Name Data Type Required Description
param id int O unique id of report

Response Format

Key Description
status success
data the deleted report object

POST : handle report (by admin)

URL

/api/admin/reports/handle/:id

Request Format

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

Response Format

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

URL

/api/admin/facility-requests/:id

Request Format

Location Field Name Data Type Required Description
param id int O unique ID of the facility registration request

Response Format

Key Description
status success
data the returned facility registration request object

GET : get all facility registration requests

URL

/api/admin/facility-requests

Request Format

Location Field Name Data Type Required Description
query user int - unique ID of the user (optional)
query status int - status of the request (optional)

Response Format

Key Description
status success
data array of facility registration request objects

POST : accept facility registration request requested by specified id

URL

/api/admin/facility-requests/:id/accept

Request Format

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

Response Format

Key Description
status success
data the accepted facility registration request object

POST : decline facility registration request requested by specified id

URL

/api/admin/facility-requests/:id/decline

Request Format

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

Response Format

Key Description
status success
data the declined facility registration request object

DELETE : delete facility registration request of specified id

URL

/api/admin/facility-requests/:id

Request Format

Location Field Name Data Type Required Description
param id int O unique ID of the request

Response Format

Key Description
status success
data the deleted facility registration request object