{"info":{"_postman_id":"55132396-e927-4658-8b71-f3d316f0a2c1","name":"Tieme Ndo","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"8821479","collectionId":"55132396-e927-4658-8b71-f3d316f0a2c1","publishedId":"SVn3saXt","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-09-27T09:25:44.000Z"},"item":[{"name":"Users","item":[{"name":"login user","id":"dcff0995-e584-4abb-b194-858fc48ad2d7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"username\": \"Pavol\",\n    \"password\": \"123456\"\n}"},"url":"https://tndo-temp-staging.herokuapp.com/api/v1/user/login","description":"<p>Login user</p>\n","urlObject":{"protocol":"https","path":["api","v1","user","login"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"ab9d0353-923f-4895-8df0-2b7977977f49","name":"login user - successfully","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"username\": \"Timi\",\n    \"password\": \"1234567\"\n}"},"url":"https://tieme-ndo-backend-staging1.herokuapp.com/api/v1/user/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"X-Dns-Prefetch-Control","value":"off"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-Xss-Protection","value":"1; mode=block"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"348"},{"key":"Etag","value":"W/\"15c-7KXVs4FOCkpYuVxQYgDNPNrKJy8\""},{"key":"Date","value":"Tue, 27 Aug 2019 09:36:06 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"User is logged in\",\n    \"user\": {\n        \"isAdmin\": false,\n        \"_id\": \"5d5fe6e6d55bdb00177eae5e\",\n        \"username\": \"Timi\",\n        \"date\": \"2019-08-23T13:15:18.181Z\",\n        \"__v\": 0\n    },\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlRpbWkiLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNTY2ODk4NTY2LCJleHAiOjE1NjY5ODQ5NjZ9.eqzv2dKkn-DsIbFm41dwEEG2JQCNlimqw3lLWi5oQGM\"\n}"}],"_postman_id":"dcff0995-e584-4abb-b194-858fc48ad2d7"},{"name":"Reset password","id":"1ee450b0-783f-440d-a8ad-43967eaed98f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImluYWtpIiwiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNTY4OTEyOTQ1LCJleHAiOjE1Njk1MTc3NDV9.XJ94ex0gcKhSBz40geDSExjWBUOFl5fX5Bzk0bqSgO4","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"currentPassword\": \"123456\",\n\t\"password\": \"123456789\"\n}"},"url":"https://tndo-temp-staging.herokuapp.com/api/v1/user/reset-password","description":"<p>Reset password of users</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"88df5493-83ec-4d93-9820-57c547a9ec91","id":"88df5493-83ec-4d93-9820-57c547a9ec91","name":"Users","type":"folder"}},"urlObject":{"protocol":"https","path":["api","v1","user","reset-password"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"1ee450b0-783f-440d-a8ad-43967eaed98f"},{"name":"create new staff","id":"99cd904c-00f7-4db0-ae08-af5ed04943bd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlBhdm9sIiwiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNTY3Njg0MzM0LCJleHAiOjE1NjgyODkxMzR9.8L7dKbK39rz2VOCrO8_SaxVUK9hTnne_K5kp8ywuk4A","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"username\": \"StaffUser10\",\n    \"password\": \"123456\"\n}"},"url":"https://tndo-temp-staging.herokuapp.com/api/v1/user/signup","description":"<p>Create new staff/admin account</p>\n","urlObject":{"protocol":"https","path":["api","v1","user","signup"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"99cd904c-00f7-4db0-ae08-af5ed04943bd"}],"id":"88df5493-83ec-4d93-9820-57c547a9ec91","description":"<p>Endpoints to the USER resource</p>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"1e6b296b-3e1d-4200-b18e-43016419d86b","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"f078ed42-e5ae-482e-a338-5b03e8a4a5ca","type":"text/javascript","exec":[""]}}],"_postman_id":"88df5493-83ec-4d93-9820-57c547a9ec91"},{"name":"Farmers","item":[{"name":"create new farmer","event":[{"listen":"prerequest","script":{"id":"9e0cbb5e-3e7a-41f0-887a-eff7ec65473c","exec":[""],"type":"text/javascript"}}],"id":"acf38acf-67ef-4dfc-8c2a-0af12fadfe3d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlBhdm9sIiwiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNTY3NzU5Mjc3LCJleHAiOjE1NjgzNjQwNzd9.AwkjSF19ASAlLqFwP5PlY2pbUocc7yPQeCo3lcs7wL4","description":"<p>Token to validate if you are a user</p>\n","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"personalInfo\": {\n        \"title\": \"Mrs\",\n        \"surname\": \"Jovi\",\n        \"first_name\": \"John\",\n        \"middle_name\": \"Bon\",\n        \"marital_status\": \"Single\",\n        \"image_url\": \"http://res.cloudinary.com/tiemendo/image/upload/v1567608371/farmers_images/bysbhlh142tiovsmmiex.jpg\",\n        \"gender\": \"Male\",\n        \"place_of_birth\": \"Accra\",\n        \"date_of_birth\": \"1995-10-22\",\n        \"id_type\": \"NHIS\",\n        \"id_number\": \"56789076543\",\n        \"district\": \"Kumasi\",\n        \"region\": \"Kumasi Central\",\n        \"community_name\": \"Loboto\",\n        \"house_name\": \"Ikee\",\n        \"house_number\": \"12\",\n        \"nearest_landmark\": \"Bustop\",\n        \"Phone_1\": \"8765456789\",\n        \"Phone_2\": \"678976546\",\n        \"education_level\": \"Tertiary\",\n        \"occupation\": \"Farmer\",\n        \"expected_income_per_month\": \"501 to GHC 1,000\",\n        \"major_source_of_income_name\": \"Crops\",\n        \"major_source_of_income_amount\": 500,\n        \"minor_source_of_income_name\": \"Crops\",\n        \"minor_source_of_income_amount\": 50\n    },\n    \"familyInfo\": {\n        \"family_size\": 3,\n        \"number_of_dependant\": 2,\n        \"highest_level_of_dependent\": \"Tertiary\",\n        \"family_income_per_month\": \"501 to GHC 1,000\"\n    },\n    \"guarantor\": {\n        \"grt_title\": \"Mrs\",\n        \"grt_surname\": \"Jupiter\",\n        \"grt_first_name\": \"Lola\",\n        \"grt_gender\": \"Male\",\n        \"grt_relations\": \"Mentor\",\n        \"grt_residential_address\": \"10, Accra\",\n        \"grt_occupation\": \"Sales\",\n        \"grt_phone\": \"45678987654\",\n        \"grt_district\": \"Guru\",\n        \"grt_region\": \"Balaa\"\n    },\n    \"farmInfo\": {\n        \"number_of_acres\": 3,\n        \"location_of_farm\": \"7, Basi, Accra\",\n        \"farm_nearest_landmark\": \"CBN\",\n        \"crops_cultivated\": [\n            \"Yam\",\n            \"Cassava\"\n        ],\n        \"animals_or_birds\": [\n            \"Goat\"\n        ]\n    }\n}"},"url":"https://tndo-temp-staging.herokuapp.com/api/v1/farmers/create","description":"<p>Create new farmer record</p>\n","urlObject":{"protocol":"https","path":["api","v1","farmers","create"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"acf38acf-67ef-4dfc-8c2a-0af12fadfe3d"},{"name":"update farmer","id":"2a4ef2a4-2108-4d19-80e9-bb479c51aca6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Ik5vbkFkbWluVGVzdCIsImlzQWRtaW4iOmZhbHNlLCJpYXQiOjE1Njg2NDYxMzcsImV4cCI6MTU2OTI1MDkzN30.EhHLV_FoCugiMw_GHcIu8ADxyRrtJlIViufEjmyuq3s","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n            \"personalInfo\": {\r\n                \"title\": \"Mr\",\r\n                \"first_name\": \"David\",\r\n                \"middle_name\": \"\",\r\n                \"surname\": \"Gonzales\"\r\n            },\r\n            \"farmInfo\": {\r\n                \"crops_cultivated\": [\r\n                    \"Rice\",\r\n                    \"Maize\"\r\n                ],\r\n                \"animals_or_birds\": [\r\n                    \"Cow\",\r\n                    \"Goat\"\r\n                ]\r\n            },\r\n            \"familyInfo\": {\r\n                \"family_size\": 2,\r\n                \"number_of_dependant\": 1\r\n            },\r\n            \"guarantor\": {\r\n                \"grt_occupation\": \"123\",\r\n                \"grt_phone\": \"123\",\r\n                \"grt_district\": \"321\",\r\n                \"grt_region\": \"312\"\r\n            }\r\n        }"},"url":"https://tndo-temp-staging.herokuapp.com/api/v1/farmers/5d70d9119d576400174ae87a/update","description":"<p>Change requests are created automatically using the famers/:id/update endpoint depending whether the user has admin rights or not.</p>\n","urlObject":{"protocol":"https","path":["api","v1","farmers","5d70d9119d576400174ae87a","update"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"2a4ef2a4-2108-4d19-80e9-bb479c51aca6"},{"name":"All farmers","id":"b7e8898b-a232-4223-8856-deebb1d56716","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InBhdm9sQWRtaW4iLCJpc0FkbWluIjp0cnVlLCJpYXQiOjE1Njc2ODU4NjQsImV4cCI6MTU2ODI5MDY2NH0.LgIiyA5KOaj2DKCl3EECN8sEjU3meSh5ksj8eXd9Tno","type":"text"}],"url":"https://tndo-temp-staging.herokuapp.com/api/v1/farmers","urlObject":{"protocol":"https","path":["api","v1","farmers"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"b7e8898b-a232-4223-8856-deebb1d56716"},{"name":"Farmer by ID","id":"6e8721d3-bcaa-4d1f-854b-896d44806e90","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InBhdm9sQWRtaW4iLCJpc0FkbWluIjp0cnVlLCJpYXQiOjE1Njc2ODU4NjQsImV4cCI6MTU2ODI5MDY2NH0.LgIiyA5KOaj2DKCl3EECN8sEjU3meSh5ksj8eXd9Tno","type":"text"}],"url":"https://tndo-temp-staging.herokuapp.com/api/v1/farmers/5d70fd7305fbb200175b8518","urlObject":{"protocol":"https","path":["api","v1","farmers","5d70fd7305fbb200175b8518"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"6e8721d3-bcaa-4d1f-854b-896d44806e90"},{"name":"farmers statistics","id":"c3512d07-f6f7-4f0b-bc11-b7ea70a5defd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlBhdm9sIiwiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNTY4Nzk1NTM3LCJleHAiOjE1Njk0MDAzMzd9.bg3Omk_UqzNp1qPEl6ixRGGX9GbW228I0CAkOFSeJf4","type":"text"}],"url":"https://tndo-temp-staging.herokuapp.com/api/v1/farmers/statistic","urlObject":{"protocol":"https","path":["api","v1","farmers","statistic"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"c3512d07-f6f7-4f0b-bc11-b7ea70a5defd"}],"id":"ef81aef4-27b5-453a-9936-520c209b783a","description":"<p>API endpoitns for FARMER resource</p>\n","_postman_id":"ef81aef4-27b5-453a-9936-520c209b783a"},{"name":"Change-Requests","item":[{"name":"Get all Change Requests","id":"adc9adf9-4241-4c12-825c-01ffcd700bd6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlBhdm9sIiwiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNTY4NjM0MDM1LCJleHAiOjE1NjkyMzg4MzV9.J1fitjQgpK92RpGAxqQELduxQ7WTUnlcf9wioMa2590","type":"text"}],"url":"https://tndo-temp-staging.herokuapp.com/api/v1/change-requests","description":"<p>Retrieves all change requests stored in the change-request collection. Does not provide the change data about each change request. Use the change-requests/:id for that.</p>\n","urlObject":{"protocol":"https","path":["api","v1","change-requests"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"adc9adf9-4241-4c12-825c-01ffcd700bd6"},{"name":"Get Change request by ID","id":"5602ab5e-ef0f-4edd-ace0-698ad5bacdc0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlBhdm9sIiwiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNTY4NjM0MDM1LCJleHAiOjE1NjkyMzg4MzV9.J1fitjQgpK92RpGAxqQELduxQ7WTUnlcf9wioMa2590","type":"text"}],"url":"https://tndo-temp-staging.herokuapp.com/api/v1/change-requests/5d7f9a864dce832d6f08ef87","description":"<p>This retrieves change request data for one change request from the server. The corresponding IDs are found in the Get all Change Requests API response. Provides only info about the changed fields.</p>\n","urlObject":{"protocol":"https","path":["api","v1","change-requests","5d7f9a864dce832d6f08ef87"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"5602ab5e-ef0f-4edd-ace0-698ad5bacdc0"},{"name":"Approve Change Request","id":"c8fc9600-f70a-4afe-9e71-c40b7ba9fa48","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlBhdm9sIiwiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNTY4NjQ2MjgyLCJleHAiOjE1NjkyNTEwODJ9.LIwmai0kX1mdskwwNV80VllHnUswSFNMSufJYU89kTk","type":"text"}],"url":"https://tndo-temp-staging.herokuapp.com/api/v1/change-requests/5d7f9a864dce832d6f08ef87/approve","description":"<p>This endpoint allows admin users to approve a specific change request. The request is deleted from the database and the corrsponding farmer is updated.</p>\n","urlObject":{"protocol":"https","path":["api","v1","change-requests","5d7f9a864dce832d6f08ef87","approve"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"c8fc9600-f70a-4afe-9e71-c40b7ba9fa48"},{"name":"Decline Change Request Copy","id":"fdc39ad9-2965-444b-9d31-f26fc7f9509e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlBhdm9sIiwiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNTY4NjQ2MjgyLCJleHAiOjE1NjkyNTEwODJ9.LIwmai0kX1mdskwwNV80VllHnUswSFNMSufJYU89kTk","type":"text"}],"url":"https://tndo-temp-staging.herokuapp.com/api/v1/change-requests/5d7fa43d052c180017d769f4/decline","description":"<p>This endpoint allows admin users to decline a specific change request. The request is deleted from the database.</p>\n","urlObject":{"protocol":"https","path":["api","v1","change-requests","5d7fa43d052c180017d769f4","decline"],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"fdc39ad9-2965-444b-9d31-f26fc7f9509e"}],"id":"479601ae-05df-48bf-916c-db0f03640967","description":"<p>API endpoints to the CHANGE-REQUEST resource.</p>\n","event":[{"listen":"prerequest","script":{"id":"08ead130-41ee-45f0-9f2f-ea63ab0139f8","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"1ea22e7a-2e27-4194-ad3a-d00702dc4d1e","type":"text/javascript","exec":[""]}}],"_postman_id":"479601ae-05df-48bf-916c-db0f03640967"},{"name":"Staging server check","id":"4dbf1fc5-8ca4-4133-bf0a-9cc5e5a07872","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"https://tndo-temp-staging.herokuapp.com/","urlObject":{"protocol":"https","path":[""],"host":["tndo-temp-staging","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"4dbf1fc5-8ca4-4133-bf0a-9cc5e5a07872"}]}