{"info":{"_postman_id":"53845cd3-367e-421b-a2bf-26a4c2a47690","name":"SQUARE API","description":"<html><head></head><body><p><strong>SquareAPI DOCS - Community Trash Collection API</strong></p>\n<p>Welcome to SquareAPI, a RESTful API built with Django to support community-driven trash collection initiatives. SquareAPI enables communities to manage and monitor trash collection points efficiently. Through its endpoints, users can create, update, and track collection points, manage collection events, and access real-time data on trash collection status. Designed with scalability and ease of use in mind, SquareAPI serves as a practical tool for keeping neighborhoods clean and organized.</p>\n<p><strong>Key Features</strong>:</p>\n<ul>\n<li><p><strong>Collection Point Management</strong>: Add, edit, and view trash collection points on a map.</p>\n</li>\n<li><p><strong>Community Participation</strong>: Facilitate volunteer tracking and community engagement in cleanup events.</p>\n</li>\n<li><p><strong>Real-Time Tracking</strong>: Monitor trash collection activities and status updates.</p>\n</li>\n</ul>\n<p><strong>Getting Started</strong>:<br>To access and use SquareAPI, set up your environment, clone the repository, and refer to our <a href=\"https://github.com/philiptitus/squareapi\">GitHub repository</a> for installation and deployment guidelines.</p>\n<p><strong>NOTE: not all Endpoints have been included in this documentation!</strong></p>\n<p>More Endpoints will be documented in the course of time.</p>\n<p>For any questions or support, please reach out to <a href=\"https://mrphilip.pythonanywhere.com/contact/\">me</a>. SquareAPI © 2024, released under the MIT License.</p>\n<img src=\"https://mrphilip.pythonanywhere.com/static/images/og.svg\"></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"31401198","collectionId":"53845cd3-367e-421b-a2bf-26a4c2a47690","publishedId":"2sAY545dod","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-11-11T19:57:39.000Z"},"item":[{"name":"Register","id":"05975182-119e-48cd-8eff-dc6ae1078682","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"{{vault:vname}}","type":"text"},{"key":"email","value":"{{vault:vname}}","type":"text"},{"key":"password","value":"{{vault:vpassword}}","type":"text"},{"key":"user_type","value":"normal","type":"text"}]},"url":"http://127.0.0.1:8000/users/register/","description":"<p>The API endpoint <code>http://127.0.0.1:8000/users/register/</code> is a POST request used to register new users. The request body should be of form-data type and include the following parameters:</p>\n<ul>\n<li><p><code>name</code> (text): The name of the user.</p>\n</li>\n<li><p><code>email</code> (text): The email address of the user.</p>\n</li>\n<li><p><code>password</code> (text): The password for the user's account.</p>\n</li>\n<li><p><code>user_type</code> (text): The type of user account.</p>\n</li>\n</ul>\n<p>The response from the last execution of this request returned a JSON object with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": 0,\n  \"name\": \"\",\n  \"_id\": 0,\n  \"isAdmin\": true,\n  \"coname\": null,\n  \"aname\": null,\n  \"password\": \"\",\n  \"last_login\": null,\n  \"is_superuser\": true,\n  \"username\": \"\",\n  \"first_name\": \"\",\n  \"last_name\": \"\",\n  \"is_staff\": true,\n  \"is_active\": true,\n  \"points\": 0,\n  \"is_demo\": true,\n  \"auth_provider\": \"\",\n  \"email\": \"\",\n  \"bio\": null,\n  \"date_joined\": \"\",\n  \"avi\": \"\",\n  \"contact_number\": null,\n  \"location\": null,\n  \"user_type\": \"\",\n  \"community\": null,\n  \"area\": null,\n  \"groups\": [],\n  \"user_permissions\": []\n}\n\n</code></pre>\n<p>This JSON schema represents the structure of the response object, including the keys and their data types. Each key may have different data types such as boolean, string, number, or null.</p>\n","urlObject":{"path":["register",""],"host":["http://127.0.0.1:8000/users"],"query":[],"variable":[]}},"response":[],"_postman_id":"05975182-119e-48cd-8eff-dc6ae1078682"},{"name":"LOGIN","id":"812b8a3b-0917-4b4c-a923-a1fe4a2a4329","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"username","value":"{{vault:vname}}","type":"text"},{"key":"password","value":"{{vault:vpassword}}","type":"text"}]},"url":"http://127.0.0.1:8000/users/login/","description":"<h3 id=\"login-user\">Login User</h3>\n<p>This endpoint allows users to log in by providing their username and password.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>username</code> (text): The username of the user.</p>\n</li>\n<li><p><code>password</code> (text): The password of the user.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><p>Status: 200</p>\n</li>\n<li><p>Content-Type: application/json</p>\n</li>\n</ul>\n<h5 id=\"response-body\">Response Body</h5>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"refresh\": \"\",\n    \"access\": \"\",\n    \"id\": 0,\n    \"_id\": 0,\n    \"username\": \"\",\n    \"email\": \"\",\n    \"name\": \"\",\n    \"isAdmin\": true,\n    \"is_demo\": true,\n    \"bio\": null,\n    \"user_type\": \"\",\n    \"token\": \"\",\n    \"expiration_time\": \"\"\n}\n\n</code></pre>\n","urlObject":{"path":["login",""],"host":["http://127.0.0.1:8000/users"],"query":[{"disabled":true,"key":"email","value":"{{vault:vname}}"},{"disabled":true,"key":"password","value":"{{vault:vpassword}}"}],"variable":[]}},"response":[],"_postman_id":"812b8a3b-0917-4b4c-a923-a1fe4a2a4329"},{"name":"Fetch My Notifications","id":"6125bba5-2ac6-40d8-8635-d8eb6b81ef77","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/users/notices/","description":"<h3 id=\"request-description\">Request Description</h3>\n<p>This endpoint retrieves a list of notices for the users.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<p>This is a GET request and does not require a request body.</p>\n<h3 id=\"response-body\">Response Body</h3>\n<p>The response is a JSON object with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"count\": integer,\n    \"next\": string or null,\n    \"previous\": string or null,\n    \"results\": [\n        {\n            \"id\": integer,\n            \"message\": string,\n            \"created_at\": string,\n            \"is_read\": boolean,\n            \"user\": integer\n        }\n    ]\n}\n\n</code></pre>\n<ul>\n<li><p><code>count</code>: The total number of notices.</p>\n</li>\n<li><p><code>next</code>: URL for the next page of notices, or null if no next page.</p>\n</li>\n<li><p><code>previous</code>: URL for the previous page of notices, or null if no previous page.</p>\n</li>\n<li><p><code>results</code>: An array of notice objects containing the following fields:</p>\n<ul>\n<li><p><code>id</code>: The unique identifier for the notice.</p>\n</li>\n<li><p><code>message</code>: The content of the notice message.</p>\n</li>\n<li><p><code>created_at</code>: The timestamp when the notice was created.</p>\n</li>\n<li><p><code>is_read</code>: A boolean indicating whether the notice has been read.</p>\n</li>\n<li><p><code>user</code>: The user ID associated with the notice.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"response-description\">Response Description</h3>\n<p>The response contains a JSON object with the list of notices, including their IDs, messages, creation timestamps, read status, and associated user IDs.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{vault:squaretoken}}"}]},"isInherited":true,"source":{"_postman_id":"53845cd3-367e-421b-a2bf-26a4c2a47690","id":"53845cd3-367e-421b-a2bf-26a4c2a47690","name":"SQUARE API","type":"collection"}},"urlObject":{"path":["notices",""],"host":["http://127.0.0.1:8000/users"],"query":[],"variable":[]}},"response":[],"_postman_id":"6125bba5-2ac6-40d8-8635-d8eb6b81ef77"},{"name":"Trash Submission","id":"6731579b-f7a3-417c-9189-48afc7dc2c86","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"trash_type\": \"plastic\",\r\n  \"point\": 1\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:8000/v1/trash/direct/","description":"<p>This endpoint allows you to make an HTTP POST request to create a new entry for a trash item directly. The request should include the trash type and the point value.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><p><code>trash_type</code>: The type of trash being added (e.g. plastic).</p>\n</li>\n<li><p><code>point</code>: The point value associated with the trash item.</p>\n</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>Upon successful creation, the endpoint returns a status code of 201 and a JSON response with the following fields:</p>\n<ul>\n<li><p><code>photo</code>: (null) The photo of the trash item, if available.</p>\n</li>\n<li><p><code>point</code>: (0) The point value associated with the trash item.</p>\n</li>\n<li><p><code>types</code>: (\"\") Additional types of the trash item.</p>\n</li>\n<li><p><code>verification_status</code>: (true) The verification status of the trash item.</p>\n</li>\n<li><p><code>timestamp</code>: (\"\") The timestamp of the trash item creation.</p>\n</li>\n</ul>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{vault:squaretoken}}"}]},"isInherited":true,"source":{"_postman_id":"53845cd3-367e-421b-a2bf-26a4c2a47690","id":"53845cd3-367e-421b-a2bf-26a4c2a47690","name":"SQUARE API","type":"collection"}},"urlObject":{"path":["trash","direct",""],"host":["http://127.0.0.1:8000/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"6731579b-f7a3-417c-9189-48afc7dc2c86"},{"name":"List Submitted Trash","id":"38cfd530-79a7-4c8b-a87a-dc6993b53ccc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/v1/trash/all/","description":"<h3 id=\"get-v1trashall\">GET /v1/trash/all/</h3>\n<p>This endpoint retrieves all trash data.</p>\n<h4 id=\"request\">Request</h4>\n<p>No request body is required for this endpoint.</p>\n<h4 id=\"response\">Response</h4>\n<p>The response will be a JSON object with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"count\": {\n            \"type\": \"integer\"\n        },\n        \"next\": {\n            \"type\": [\"string\", \"null\"]\n        },\n        \"previous\": {\n            \"type\": [\"string\", \"null\"]\n        },\n        \"results\": {\n            \"type\": \"array\",\n            \"items\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"photo\": {\n                        \"type\": [\"string\", \"null\"]\n                    },\n                    \"point\": {\n                        \"type\": \"integer\"\n                    },\n                    \"types\": {\n                        \"type\": \"string\"\n                    },\n                    \"verification_status\": {\n                        \"type\": \"boolean\"\n                    },\n                    \"timestamp\": {\n                        \"type\": \"string\"\n                    }\n                }\n            }\n        }\n    }\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{vault:squaretoken}}"}]},"isInherited":true,"source":{"_postman_id":"53845cd3-367e-421b-a2bf-26a4c2a47690","id":"53845cd3-367e-421b-a2bf-26a4c2a47690","name":"SQUARE API","type":"collection"}},"urlObject":{"path":["trash","all",""],"host":["http://127.0.0.1:8000/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"38cfd530-79a7-4c8b-a87a-dc6993b53ccc"},{"name":"Retrieve Collection Points Close To You.","id":"0080a2a9-734d-45be-947d-8fbee5bf8214","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"coordinates","value":"-1.29468592,36.79896961","type":"text"}]},"url":"http://127.0.0.1:8000/v1/points/","description":"<h3 id=\"post-v1points\">POST /v1/points/</h3>\n<p>This endpoint allows the user to submit coordinates for processing.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><code>coordinates</code> (text): The coordinates data in text format.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><p>Status: 200</p>\n</li>\n<li><p>Content-Type: application/json</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"count\": 0,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 0,\n            \"location\": \"\",\n            \"estate\": \"\",\n            \"types\": \"\",\n            \"admin_area\": 0\n        }\n    ]\n}\n\n</code></pre>\n<p>The response contains the count of results and an array of point details including id, location, estate, types, and admin_area.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{vault:squaretoken}}"}]},"isInherited":true,"source":{"_postman_id":"53845cd3-367e-421b-a2bf-26a4c2a47690","id":"53845cd3-367e-421b-a2bf-26a4c2a47690","name":"SQUARE API","type":"collection"}},"urlObject":{"path":["points",""],"host":["http://127.0.0.1:8000/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"0080a2a9-734d-45be-947d-8fbee5bf8214"},{"name":"List All Collection Administration Areas.","id":"151db9ee-09bd-4f6b-8855-9b2cf8474ada","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/v1/admin-areas/","description":"<h1 id=\"retrieve-admin-areas\">Retrieve Admin Areas</h1>\n<p>This endpoint makes an HTTP GET request to fetch a list of admin areas.</p>\n<h2 id=\"request\">Request</h2>\n<h3 id=\"request-body\">Request Body</h3>\n<p>This request does not require a request body.</p>\n<h3 id=\"request-parameters\">Request Parameters</h3>\n<ul>\n<li>None</li>\n</ul>\n<h2 id=\"response\">Response</h2>\n<p>Upon a successful execution, the API returns a JSON response with the following fields:</p>\n<ul>\n<li><p><code>count</code> (integer): The total count of admin areas.</p>\n</li>\n<li><p><code>next</code> (string): The URL for the next page of results, if available.</p>\n</li>\n<li><p><code>previous</code> (string): The URL for the previous page of results, if available.</p>\n</li>\n<li><p><code>results</code> (array): An array of admin area objects, each containing the following fields:</p>\n<ul>\n<li><p><code>id</code> (integer): The unique identifier for the admin area.</p>\n</li>\n<li><p><code>aname</code> (string): The admin area name.</p>\n</li>\n<li><p><code>name</code> (string): The name of the admin area.</p>\n</li>\n<li><p><code>coordinates</code> (string): The coordinates of the admin area.</p>\n</li>\n<li><p><code>main_coordinate</code> (string): The main coordinate of the admin area.</p>\n</li>\n<li><p><code>admin</code> (integer): The admin identifier associated with the admin area.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"sample-response\">Sample Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"count\": 0,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 0,\n            \"aname\": \"\",\n            \"name\": \"\",\n            \"coordinates\": \"\",\n            \"main_coordinate\": \"\",\n            \"admin\": 0\n        }\n    ]\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{vault:squaretoken}}"}]},"isInherited":true,"source":{"_postman_id":"53845cd3-367e-421b-a2bf-26a4c2a47690","id":"53845cd3-367e-421b-a2bf-26a4c2a47690","name":"SQUARE API","type":"collection"}},"urlObject":{"path":["admin-areas",""],"host":["http://127.0.0.1:8000/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"151db9ee-09bd-4f6b-8855-9b2cf8474ada"},{"name":"Join An Administrative Area","id":"1e514041-c6e3-4ddc-ab7e-a74a27c589f6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"coordinates","value":"-0.7765920711509802, 35.33698160201311","type":"text"}]},"url":"http://127.0.0.1:8000/v1/join/","description":"<h3 id=\"join-community\">Join Community</h3>\n<p>This endpoint allows the user to join a community by providing their coordinates.</p>\n<h4 id=\"request-body-parameters\">Request Body Parameters</h4>\n<ul>\n<li><code>coordinates</code> (text): The user's coordinates.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response is in JSON format and includes the following fields:</p>\n<ul>\n<li><p><code>detail</code>: Details about the join operation.</p>\n</li>\n<li><p><code>community</code>: Information about the community joined.</p>\n</li>\n</ul>\n<h4 id=\"json-schema\">JSON Schema</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"detail\": {\"type\": \"string\"},\n        \"community\": {\"type\": \"string\"}\n    }\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{vault:squaretoken}}"}]},"isInherited":true,"source":{"_postman_id":"53845cd3-367e-421b-a2bf-26a4c2a47690","id":"53845cd3-367e-421b-a2bf-26a4c2a47690","name":"SQUARE API","type":"collection"}},"urlObject":{"path":["join",""],"host":["http://127.0.0.1:8000/v1"],"query":[{"disabled":true,"key":"","value":null}],"variable":[]}},"response":[],"_postman_id":"1e514041-c6e3-4ddc-ab7e-a74a27c589f6"},{"name":"Retrieve A Single Administration Area","id":"8c5f056d-6304-44b8-b99f-22502d2621f4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/v1/admin-areas/1/","description":"<p>The endpoint <code>http://127.0.0.1:8000/v1/admin-areas/1/</code> makes an HTTP GET request to retrieve information about a specific admin area.</p>\n<h3 id=\"response\">Response</h3>\n<p>The response will be a JSON object with the following properties:</p>\n<ul>\n<li><p><code>id</code> (number): The ID of the admin area.</p>\n</li>\n<li><p><code>aname</code> (string): The name of the admin area.</p>\n</li>\n<li><p><code>name</code> (string): Another name associated with the admin area.</p>\n</li>\n<li><p><code>coordinates</code> (string): The coordinates of the admin area.</p>\n</li>\n<li><p><code>main_coordinate</code> (string): The main coordinate of the admin area.</p>\n</li>\n<li><p><code>admin</code> (number): The admin status of the area.</p>\n</li>\n</ul>\n<p>Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": 0,\n    \"aname\": \"\",\n    \"name\": \"\",\n    \"coordinates\": \"\",\n    \"main_coordinate\": \"\",\n    \"admin\": 0\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{vault:squaretoken}}"}]},"isInherited":true,"source":{"_postman_id":"53845cd3-367e-421b-a2bf-26a4c2a47690","id":"53845cd3-367e-421b-a2bf-26a4c2a47690","name":"SQUARE API","type":"collection"}},"urlObject":{"path":["admin-areas","1",""],"host":["http://127.0.0.1:8000/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"8c5f056d-6304-44b8-b99f-22502d2621f4"},{"name":"Retrieve Info About A Single Trash Disposal Point","id":"7a3a8eb9-5dad-44ef-99c2-0a4310afeb3d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/v1/point/1/","description":"<p>The <code>GET /v1/point/1/</code> endpoint retrieves information about a specific point. The response returned is a JSON object with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"id\": {\n            \"type\": \"integer\"\n        },\n        \"location\": {\n            \"type\": \"string\"\n        },\n        \"estate\": {\n            \"type\": \"string\"\n        },\n        \"types\": {\n            \"type\": \"string\"\n        },\n        \"admin_area\": {\n            \"type\": \"integer\"\n        }\n    }\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{vault:squaretoken}}"}]},"isInherited":true,"source":{"_postman_id":"53845cd3-367e-421b-a2bf-26a4c2a47690","id":"53845cd3-367e-421b-a2bf-26a4c2a47690","name":"SQUARE API","type":"collection"}},"urlObject":{"path":["point","1",""],"host":["http://127.0.0.1:8000/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"7a3a8eb9-5dad-44ef-99c2-0a4310afeb3d"}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{vault:squaretoken}}"}]}},"event":[{"listen":"prerequest","script":{"id":"0a78d279-df98-4732-be58-29bb9757f3af","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"371a5c4a-ace0-419c-b4ad-a55285075f16","type":"text/javascript","packages":{},"exec":[""]}}],"variable":[{"key":"api","value":"http://127.0.0.1:8000/","type":"string"}]}