{"info":{"_postman_id":"33dc698b-c818-4be8-b5a3-bc106021487b","name":"Population Management API","description":"<html><head></head><body><p> This is a Population Management System that contains a list of locations and the total number of residents in each location broken down by gender.</p>\n<p>We have provided an API that enables you to:</p>\n<p>** Create a new location containing data on the total number of male and female residents within it. **  Please note that locations can be nested within other locations\n** List all available locations and their population summaries (total male residents, total female residents, sum total residents) **\n** Update data for a specific locations **\n**Delete a specified location **</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"2052029","collectionId":"33dc698b-c818-4be8-b5a3-bc106021487b","publishedId":"RznLGbGX","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-01-17T13:03:03.000Z"},"item":[{"name":"Create a new Location","id":"64005fd9-952d-465d-b623-4a3792a34874","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"locationName\": \"Paris\",\n\t\"male\": 700,\n\t\"female\": 1200,\n\t\"parentLocationId\": 1\n}"},"url":"https://population-management-api.herokuapp.com/locations","description":"<p>This request creates a new location using the following json format:\n{\n    \"locationName\": \"value\",\n    \"male\": value,\n    \"female\": value,\n    \"parentLocationId\": value\n}</p>\n<p>where both male and female values can only be non-negative integer values while parentLocationId can be a reference to another location id or null if no reference is found</p>\n","urlObject":{"protocol":"https","path":["locations"],"host":["population-management-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"6d2e119f-fa7f-474d-bed4-5592f63445e2","name":"Create a new Location","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"locationName\": \"Paris\",\n\t\"male\": 700,\n\t\"female\": 1200,\n\t\"parentLocationId\": 1\n}"},"url":"https://population-management-api.herokuapp.com/locations"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"225"},{"key":"Etag","value":"W/\"e1-j2kkyolvVi0hH+WfiyAW9gKTE38\""},{"key":"Date","value":"Thu, 17 Jan 2019 13:05:24 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Location created successfully\",\n    \"data\": {\n        \"id\": 2,\n        \"locationName\": \"Paris\",\n        \"male\": 700,\n        \"female\": 1200,\n        \"parentLocationId\": 1,\n        \"updatedAt\": \"2019-01-17T13:05:24.702Z\",\n        \"createdAt\": \"2019-01-17T13:05:24.702Z\"\n    }\n}"},{"id":"daae31ed-04be-4fdb-a51f-d1612094d0c2","name":"Create a new Location","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"locationName\": \"France\",\n\t\"male\": 500,\n\t\"female\": 600,\n\t\"parentLocationId\": null\n}"},"url":"https://population-management-api.herokuapp.com/locations"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"228"},{"key":"Etag","value":"W/\"e4-ttA6XXqtllGu9lRWUhrPZ+NYCC0\""},{"key":"Date","value":"Thu, 17 Jan 2019 12:57:30 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Location created successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"locationName\": \"France\",\n        \"male\": 500,\n        \"female\": 600,\n        \"parentLocationId\": null,\n        \"updatedAt\": \"2019-01-17T12:57:30.395Z\",\n        \"createdAt\": \"2019-01-17T12:57:30.395Z\"\n    }\n}"}],"_postman_id":"64005fd9-952d-465d-b623-4a3792a34874"},{"name":"Get all Locations","id":"f0c0acba-4130-432e-b998-59a861b3ce96","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://population-management-api.herokuapp.com/locations","description":"<p>This endpoint fetches all locations and child locations stored in the Database and also sums up the total of male and female fields in both the parent location and child location</p>\n","urlObject":{"protocol":"https","path":["locations"],"host":["population-management-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"0c8418db-0581-4410-815e-06b03db88e7a","name":"Get all Locations","originalRequest":{"method":"GET","header":[],"url":"https://population-management-api.herokuapp.com/locations"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"453"},{"key":"Etag","value":"W/\"1c5-MTZF66VyIqdh/+9zKFPOh+9yR1w\""},{"key":"Date","value":"Thu, 17 Jan 2019 13:13:07 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Get all locations was successfull\",\n    \"data\": [\n        {\n            \"id\": 1,\n            \"locationName\": \"France\",\n            \"male\": 500,\n            \"female\": 600,\n            \"parentLocationId\": null,\n            \"childLocation\": [\n                {\n                    \"id\": 2,\n                    \"locationName\": \"Paris\",\n                    \"male\": 700,\n                    \"female\": 1200,\n                    \"createdAt\": \"2019-01-17T13:05:24.702Z\",\n                    \"updatedAt\": \"2019-01-17T13:05:24.702Z\",\n                    \"parentLocationId\": 1\n                }\n            ],\n            \"total\": 3000\n        },\n        {\n            \"id\": 2,\n            \"locationName\": \"Paris\",\n            \"male\": 700,\n            \"female\": 1200,\n            \"parentLocationId\": 1,\n            \"childLocation\": [],\n            \"total\": 1900\n        }\n    ]\n}"}],"_postman_id":"f0c0acba-4130-432e-b998-59a861b3ce96"},{"name":"Update a location name","id":"9cd1a395-1051-4dd9-bf88-04e2b245b698","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"locationName\": \"Paris\",\n\t\"male\": 700,\n\t\"female\": 2000,\n\t\"parentLocationId\": 1\n}"},"url":"https://population-management-api.herokuapp.com/locations/Lens","description":"<p>This endpoint allows you to update a location by name</p>\n","urlObject":{"protocol":"https","path":["locations","Lens"],"host":["population-management-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"985206ed-61a1-4675-9326-2f4a527e5a90","name":"Update a location name","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"locationName\": \"Paris\",\n\t\"male\": 700,\n\t\"female\": 2000,\n\t\"parentLocationId\": 1\n}"},"url":"https://population-management-api.herokuapp.com/locations/Lens"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"71"},{"key":"Etag","value":"W/\"47-NYmkHwDrWC/aG3q2PKvI9CozxZ0\""},{"key":"Date","value":"Thu, 17 Jan 2019 13:17:04 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Location name was updated successfully\"\n}"}],"_postman_id":"9cd1a395-1051-4dd9-bf88-04e2b245b698"},{"name":"Delete a Location by name","id":"9d25adab-0591-4617-b781-eba8f0748717","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"https://population-management-api.herokuapp.com/locations/Lens","description":"<p>This endpoints allows you to delete a location by name</p>\n","urlObject":{"protocol":"https","path":["locations","Lens"],"host":["population-management-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"604e59e3-f5c1-412c-8f4e-29f41d658f93","name":"Delete a Location by name","originalRequest":{"method":"DELETE","header":[],"url":"https://population-management-api.herokuapp.com/locations/Lens"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"67"},{"key":"Etag","value":"W/\"43-hzjpk/KZat/DSeqQWsC3DfKwM5A\""},{"key":"Date","value":"Thu, 17 Jan 2019 13:20:17 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Location name deleted successfully\"\n}"}],"_postman_id":"9d25adab-0591-4617-b781-eba8f0748717"}]}