Skip to content

Latest commit

 

History

History
87 lines (63 loc) · 1.21 KB

File metadata and controls

87 lines (63 loc) · 1.21 KB

API

GET | Get Services From Country Code

[server]:8000/api/get_country?country_code=[country code]

Get all services with a country code

Outputs

Status Response
200 application/json
List of JSON objects

JSON Response

[
 {
  "Ref":"REFER1",
  "Centre":"Centre Name",
  "Service":"Service Name",
  "Country":"cn"
 }
]

POST | Add Service

Add service to database

[server]:8000/api/add_service

Request Headers

Content-Type: application/json

{
 "Ref":"REFREF1",
 "Centre":"Centre Name",
 "Service":"Service Name",
 "Country":"cn"
}

Outputs

Status Responses
200
400 String output
"cannot add duplicate service"
"missing parameters from POST request"
PDOException
500 "cannot connect to server"

POST | Edit Service

Edit service in database

[server]:8000/api/update_service

Request Headers

Content-Type: application/json

{
 "Ref":"REFREF1",
 "Centre":"Centre Name",
 "Service":"Service Name",
 "Country":"cn"
}

Outputs

Status Responses
200
400 "missing parameters from POST request"
500 PDOException