Skip to content

Instantly share code, notes, and snippets.

@jwaiswa7
Last active July 27, 2020 10:07
Show Gist options
  • Save jwaiswa7/4290e95b26c9ee9f3e54f9573f9f39ac to your computer and use it in GitHub Desktop.
Save jwaiswa7/4290e95b26c9ee9f3e54f9573f9f39ac to your computer and use it in GitHub Desktop.

This is for the Track Covid application API calls

Main endpoint is http://35.179.92.187/

Register user

Receive user details

Request:
Method: Get End Point: /api/v1/users/:imei

Parameters: id - User's imei

Response:

{
"id": "cfbc010b-087a-460c-9fc7-673a9d6f58d4",
"imei": "b8e33677-7daf-461f-b8aa-d8c434fb2781",
"status": "green",
"nin": null,
"movements": [],
}

Create and send user details

Request: Method: POST End point: /api/v1/users

Request data (Formart JSON)

{"data":
  {
    "imei":"testimei",
    "longitude":30.234,
    "latitude":0.321
  }
}

Response:

{
  "id": "03bd7175-fc56-4235-8daa-3443fb199a73",
  "imei": "testimei",
  "status": "green",
  "nin": null,
  "movements": [],
}

If someone is using transport means line a car

request:

{"data":{
  "imei":"testimei1", 
  "transport":"f8c1489a-33de-4d9c-a970-edd88c966747"
  }
}

Note: Tranpsort is a value read form the transport means QR code

response

{
"id": "abdb4d8a-299f-4e56-8688-c9b4147169a6",
"imei": "testimei1",
"status": "green",
"nin": null,
"movements": [
  {
    "id": "1f3ff26b-73a2-4365-b9c2-6a31871fd47d",
    "created_at": "27/07/20 , 10:04 AM",
    "address": "Entebbe Airport"
  }
 ],
}

Note: This response has a record of user's previous movement

Get hotspots

Method: GET End point /api/v1/hot_spots

Response:

[
  {
    "id":"9f220c5e-9563-4333-9384-7288620e6282",
    "short_address":"Nukmba University",
    "status":"green"
  },
  {
    "id":"f8c1489a-33de-4d9c-a970-edd88c966747",
    "short_address":"Entebbe Airport","status":"green"
    },
  {
  "id":"4d4f13f4-7c15-4c03-8417-7bdb7605c709",
  "short_address":"Victoria Mall",
  "status":"green"
  },
  {
    "id":"dcc73134-6608-44a1-b9ee-f46901ef3dd7",
    "short_address":"Imperial Mall",
    "status":"green"
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment