Методы API (черновик) - Herd-Immunity/GRLS-parser GitHub Wiki
Возвращает список всех инфекций.
-
URL
/GetInfections
-
Method:
GET -
URL Params
None
-
Data Params
None
-
Success Response:
-
Code: 200
Content:
-
Code: 200
{
[{
id: 1,
name: "столбняк",
amount: 15,
sortOrder: 1
}, {
id: 2,
name: "дифтерия",
amount: 13,
sortOrder: 2
}
]
}-
Error Response:
-
Code: 404 NOT FOUND
Content:{ error : "Endpoint does not exist" }
-
Code: 404 NOT FOUND
-
Sample Call:
$.ajax({ url: "/GetInfections", dataType: "json", type : "GET", success : function(r) { console.log(r); } });
Возвращает список всех противопоказаний.
-
URL
/GetRestrictions
-
Method:
GET -
URL Params
None
-
Data Params
None
-
Success Response:
-
Code: 200
Content:
-
Code: 200
{
[{
id: 1,
name: "аллергия",
sortOrder: 1
}, {
id: 2,
name: "беременность",
sortOrder: 2
}
]
}-
Error Response:
-
Code: 404 NOT FOUND
Content:{ error : "Endpoint does not exist" }
-
Code: 404 NOT FOUND
-
Sample Call:
$.ajax({ url: "/GetRestrictions", dataType: "json", type : "GET", success : function(r) { console.log(r); } });
Возвращает список мета-объектов всех вакцин
-
URL
/GetVaccinesList
-
Method:
GET -
URL Params
None
-
Data Params
None
-
Success Response:
-
Code: 200
Content:
-
Code: 200
{
[{
id: 1,
name: "ЭпиВакКорона",
infectionId: 1,
injectionType: "intramuscular"
restrictions: [1,2,3],
ageRestrictions: ("18","60")
}, {
id: 2,
name: "Спутник V",
infectionId: 2,
injectionType: "intramuscular"
restrictions: [2,3],
ageRestrictions: ("18","60")
}
]
}-
Error Response:
-
Code: 404 NOT FOUND
Content:{ error : "Endpoint does not exist" }
-
Code: 404 NOT FOUND
-
Sample Call:
$.ajax({ url: "/GetVaccinesList", dataType: "json", type : "GET", success : function(r) { console.log(r); } });
Возвращает полный объект вакцины
-
URL
/GetVaccine?id=1
-
Method:
GET -
URL Params
Required:
id=[integer]идентификатор вакцины -
Data Params
None
-
Success Response:
-
Code: 200
Content:
-
Code: 200
{
id: 1,
name: "ЭпиВакКорона",
infectionId: 1,
injectionType: "intramuscular"
restrictions: [1,2,3],
ageRestrictions: ("18","60"),
description: "Наша замечательная вакцина лучше всех",
pictureIds: [1,2,3]
}-
Error Response:
-
Code: 404 NOT FOUND
Content:{ error : "Endpoint does not exist" }
-
Code: 404 NOT FOUND
-
Sample Call:
$.ajax({ url: "/GetVaccine?id=1", dataType: "json", type : "GET", success : function(r) { console.log(r); } });