-
Notifications
You must be signed in to change notification settings - Fork 1
/
covid19IndiaPortal.http
61 lines (52 loc) · 2.04 KB
/
covid19IndiaPortal.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
POST http://localhost:3000/login/
Content-Type: application/json
{
"username": "christopher_phillips",
"password": "christy@123"
}
###
// API 2
// Returns a list of all states in the state table
GET http://localhost:3000/states/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNocmlzdG9waGVyX3BoaWxsaXBzIiwiaWF0IjoxNjI0MTEyNDYzfQ.yWmLJkXHpJzXjY8qbKNRtsbh4bS-imUxRu-VJniDofI
###
//API 3
// Returns a state based on the state ID
GET http://localhost:3000/states/5/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNocmlzdG9waGVyX3BoaWxsaXBzIiwiaWF0IjoxNjI0MTEyNDYzfQ.yWmLJkXHpJzXjY8qbKNRtsbh4bS-imUxRu-VJniDofI
###
//API 4
//Create a district in the district table, district_id is auto-incremented
POST http://localhost:3000/districts/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNocmlzdG9waGVyX3BoaWxsaXBzIiwiaWF0IjoxNjI0MTEyNDYzfQ.yWmLJkXHpJzXjY8qbKNRtsbh4bS-imUxRu-VJniDofI
Content-Type: application/json
{
"districtName": "Bagalkot",
"stateId": 3,
"cases": 2323,
"cured": 2000,
"active": 315,
"deaths": 8
}
###
//API 6
//Deletes a district from the district table based on the district ID
DELETE http://localhost:3000/districts/3/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNocmlzdG9waGVyX3BoaWxsaXBzIiwiaWF0IjoxNjI0MTEyNDYzfQ.yWmLJkXHpJzXjY8qbKNRtsbh4bS-imUxRu-VJniDofI
###
//API 7
//Updates the details of a specific district based on the district ID
PUT http://localhost:3000/districts/3/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNocmlzdG9waGVyX3BoaWxsaXBzIiwiaWF0IjoxNjI0MTEyNDYzfQ.yWmLJkXHpJzXjY8qbKNRtsbh4bS-imUxRu-VJniDofI
Content-Type: application/json
{
"districtName": "Nadia",
"stateId": 3,
"cases": 9628,
"cured": 6524,
"active": 3000,
"deaths": 104
}
###
GET http://localhost:3000/states/2/stats/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNocmlzdG9waGVyX3BoaWxsaXBzIiwiaWF0IjoxNjI0MTEyNDYzfQ.yWmLJkXHpJzXjY8qbKNRtsbh4bS-imUxRu-VJniDofI