{"info":{"_postman_id":"2e485580-71a8-45fd-8c62-cd27b04929fd","name":"Report Analytics","description":"<html><head></head><body><p>A Nodejs (javascript) API to build a lightweight analytics reporting service that implements the following API Endpoints for Storing the IP and Coordinates and for Fetching the IP and Coordinates and calculates the of a path that is traced through\nthe coordinates stored for the IP over the last one hour:</p>\n<ul>\n<li><b>StoreActivityForIP</b></li>\n<b>Method</b>: POST <br>\n<b>Endpoint</b>: /analytics <br>\n<b>Sample request</b>: <br>\n{ <br>\nip: “198.244.98.1“, <br> \ncoordinates: { <br>\nx: 145.53, <br>\ny: 44.56 <br>\n} \n} <br>\n</ul>\n<br>\n\n <br>\n<ul>\n<li><b>FetchActivityForIP</b></li>\n<b>Method</b>: GET <br>\n<b>Endpoint</b>: /analytics?ip={an ip address} <br>\n<b>Sample response</b>: <br>\n{ distance: 3748.38 }<br>\n</ul>\n<br></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"13856921","collectionId":"2e485580-71a8-45fd-8c62-cd27b04929fd","publishedId":"TzXumeXS","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-05-24T14:07:33.000Z"},"item":[{"name":"Fetch Analytics","id":"1e4951ed-0230-4312-b8ec-3c9371b8320d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://analytics-reporting-service.herokuapp.com/analytics?ip=190.60.80.10","description":"<p>This endpoint returns a calculated length of a path that is traced through the coordinates stored for the IP over the last one hour.\n<b>Endpoint:</b> /analytics <br /></p>\n<h1>Sample Request</h1> <br />\n<ul>\n<li><b>FetchActivityForIP</b></li>\n<b>Method</b>: GET <br />\n<b>Endpoint</b>: /analytics?ip={an ip address} <br />\n<b>Sample response</b>: <br />\n{ distance: 3748.38 }<br />\n</ul>\n<br />\n\n<p><b>Status Codes</b> <br />\n<code>\n-500: Server error (Invalid Password hashing or Invalid Data) <br />\n-404: No coordinates found with that IP (Invalid IP) <br />\n-200: Success (Distance successfully calculated) <br />\n</code></p>\n","urlObject":{"protocol":"https","path":["analytics"],"host":["analytics-reporting-service","herokuapp","com"],"query":[{"key":"ip","value":"190.60.80.10"}],"variable":[]}},"response":[],"_postman_id":"1e4951ed-0230-4312-b8ec-3c9371b8320d"},{"name":"Store Analytics","id":"1d27394d-f981-4c65-9012-b60069610647","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"ip\": \"190.60.80.10\",\n\t\"coordinates\": {\n\t\t\"x\": 300,\n\t\t\"y\": 700\n\t}\n}","options":{"raw":{"language":"json"}}},"url":"https://analytics-reporting-service.herokuapp.com/analytics","description":"<p>This endpoint stores the IP and Coordinates entered by the User in a file. <br />\n<br />\n<b>Sample Request</b>: <br />\n<code>\n{ <br />\n    ip: \"198.244.98.1\", <br />\n    coordinates: { <br />\n         x: 145.53, <br />\n         y: 44.56 <br />\n}}\n</code>\n<br /></p>\n<p><b>Status Codes</b> <br />\n<code>\n-500: Server error (Invalid Password hashing or Invalid Data) <br />\n-404: File does not exist <br />\n-201: Success (IP and Coordinates successfully taken and stored) <br />\n</code></p>\n","urlObject":{"protocol":"https","path":["analytics"],"host":["analytics-reporting-service","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"1d27394d-f981-4c65-9012-b60069610647"}]}