{"info":{"_postman_id":"df5e9e7e-24b4-42cf-8d83-78beec11cfae","name":"practice-app/post-info","description":"<html><head></head><body><p>This is the API documentation of post-info/ from our CMPE352 practice-app project. This API has 2 functionalities: GET and POST.</p>\n<p>GET is used to get a post from the database providing its post id.</p>\n<p>POST is used to update the attributes of an existing post in the database.</p>\n<p>User must be logged in to use these functionalities. There is basic authentication initialized for Postman testing purposes.</p>\n<p>To use the api, user should enter the id of the post at the end of the url as seen in the sample calls.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"20881320","collectionId":"df5e9e7e-24b4-42cf-8d83-78beec11cfae","publishedId":"UyxnEQnH","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-05-19T11:14:58.000Z"},"item":[{"name":"GET a post","id":"b2e82a01-2691-4268-a505-1ff83cc5bea0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]},"isInherited":false},"method":"GET","header":[],"body":{"mode":"formdata","formdata":[{"key":"post_id","value":"1","type":"text"}]},"url":"http://127.0.0.1:8000/post-info/api/1/","description":"<p>Fetching a post from the database providing its post id with GET request.</p>\n","urlObject":{"protocol":"http","port":"8000","path":["post-info","api","1",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"c09e947b-b6d1-4234-b649-e1d4ea6bf4e5","name":"GET a post","originalRequest":{"method":"GET","header":[],"body":{"mode":"formdata","formdata":[{"key":"post_id","value":"1","type":"text"}]},"url":"http://127.0.0.1:8000/post-info/api/1/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 19 May 2022 11:07:55 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.10.0"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"186"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"title\": \"tit\",\n    \"body\": \"bod\",\n    \"category\": 2,\n    \"user\": 1,\n    \"timestamp\": \"2022-05-18T14:30:45.577836Z\",\n    \"country\": \"Italy\",\n    \"covid19cases\": {\n        \"death\": 102,\n        \"case\": 13776\n    },\n    \"nof_upvotes\": 0,\n    \"nof_downvotes\": 0\n}"}],"_postman_id":"b2e82a01-2691-4268-a505-1ff83cc5bea0"},{"name":"POST: update a post","id":"98b95ef3-05e4-4347-85d5-41c505035fc2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"title","value":"new title","type":"text"},{"key":"body","value":"new body","type":"text"},{"key":"country","value":"Turkey","type":"text"},{"key":"category","value":"1","type":"text"}]},"url":"http://127.0.0.1:8000/post-info/api/1/","description":"<p>Updating a post in the database with POST request providing its post id and its new title, body, category and country. Covid19cases are retrieved from an external API (<a href=\"https://api.covid19api.com/\">https://api.covid19api.com/</a>) using the given country name. Timestamp is also updated according to the update time.</p>\n","urlObject":{"protocol":"http","port":"8000","path":["post-info","api","1",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"c45f68b8-24ce-4915-b276-3c3b6110219b","name":"Update a post","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"title","value":"new title","type":"text"},{"key":"body","value":"new body","type":"text"},{"key":"country","value":"Turkey","type":"text"},{"key":"category","value":"1","type":"text"}]},"url":"http://127.0.0.1:8000/post-info/api/1/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 19 May 2022 11:12:07 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.10.0"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"195"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"title\": \"new title\",\n    \"body\": \"new body\",\n    \"category\": 1,\n    \"user\": 1,\n    \"timestamp\": \"2022-05-19T11:12:07.331782Z\",\n    \"country\": \"Turkey\",\n    \"covid19cases\": {\n        \"death\": 3,\n        \"case\": 1443\n    },\n    \"nof_upvotes\": 0,\n    \"nof_downvotes\": 0\n}"}],"_postman_id":"98b95ef3-05e4-4347-85d5-41c505035fc2"}]}