{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"abeac584-b656-4960-a0cd-4b166aab28a7","name":"MAILBOX","description":"# Overview\n\nThe API for the MAILBOX application provides a set of endpoints for retrieving and managing the user's messages.\n\n## Predefined user information\n\n{  \n\"name\" : Natasha  \n\"email\": [admin@gmail.com](mailto:admin@gmail.com)  \n\"password\": Admin@2323  \n}\n\n## Endpoints\n\nStartFragmentroutragment\n\n### **1\\. Signup a user**\n\n**Description**\n\nThis endpoint is used to create an account for a user.\n\n- **URL** : /api/user/signup\n- **Method** : `POST`\n- **Auth Required** : `False`\n- **Permissions Required** : `None`\n    \n\n**Sample Request**\n\n``` json\n{\n  \"name\": \"Max\",\n  \"email\": \"Max@gmail.com\",\n  \"password\": \"Max@2323\"\n}\n\n```\n\n**Sample Response**\n\n```\nHTTP/1.1 200 OK\n{\n  \"name\": \"Max\",\n  \"email\": \"Max@gmail.com\",\n  \"password\": \"Max@2323\"\n}\n\n```\n\n### 2\\. LOG IN\n\n**Description**\n\nThis endpoint is used to log into the app.\n\n- **URL** : /api/user/login\n- **Method** : `POST`\n- **Auth Required** : `True`\n- **Permissions Required** : `None`\n    \n\nSample Request\n\n``` json\n{\n  \"name\": \"Max\",\n  \"email\": \"Max@gmail.com\",\n  \"password\": \"Max@2323\"\n}\n\n```\n\n### 3\\. Get all messages\n\n- **URL** : `/api/messages/`\n- **Method** : `GET`\n- **Auth Required** : `True`\n- **Permissions Required** : `None`\n    \n\n**Sample Response**\n\n``` json\nHTTP/1.1 200 OK\n[\n  {\n    \"_id\": \"63d5b04668ddff00fe867518\",\n    \"subject\": \"Friendly Message\",\n    \"content\": \"Hey , how are you, its been long .I hope you are okay.\",\n    \"isRead\": true,\n    \"createdAt\": \"2023-01-28T23:31:18.082Z\",\n    \"updatedAt\": \"2023-01-30T14:21:42.402Z\",\n    \"__v\": 0\n  },\n  {\n    \"_id\": \"63d5afd368ddff00fe867510\",\n    \"subject\": \"Amazon Parcel Status\",\n    \"content\": \"Your parcel has arrived and will be delivered on the 20th to your address\",\n    \"isRead\": false,\n    \"createdAt\": \"2023-01-28T23:29:23.716Z\",\n    \"updatedAt\": \"2023-01-30T23:33:31.499Z\",\n    \"__v\": 0\n  },\n  {\n    \"_id\": \"63d5af5c68ddff00fe86750c\",\n    \"subject\": \"Homework Submission\",\n    \"content\": \"Contrary to popular belief, Lorem Ipsum is not simply random text\",\n    \"isRead\": false,\n    \"createdAt\": \"2023-01-28T23:27:24.728Z\",\n    \"updatedAt\": \"2023-01-30T14:18:20.741Z\",\n    \"__v\": 0\n  },\n  {\n    \"_id\": \"63d531363f174cf46521dc3f\",\n    \"subject\": \"Welcome\",\n    \"content\": \"A wonderful serenity has taken possession of my entire soul, like these sweet mornings\",\n    \"isRead\": false,\n    \"createdAt\": \"2023-01-28T14:29:10.594Z\",\n    \"updatedAt\": \"2023-01-30T14:18:12.012Z\",\n    \"__v\": 0\n  }\n]\n\n```\n\n### 4\\. Get a single message\n\n- **URL** : `/api/messages/:id`\n- **Method** : `GET`\n- **Auth Required** : `True`\n- **Permissions Required** : `None`\n    \n\n\\*_Sample request__\\*_\n\n```\nhttp://localhost:4000/api/messages/63d5af5c68ddff00fe86750c\n\n```\n\n\\*_Sample Response__\\*_\n\n``` json\n{\n  \"_id\": \"63d5af5c68ddff00fe86750c\",\n  \"subject\": \"Homework Submission\",\n  \"content\": \"Contrary to popular belief, Lorem Ipsum is not simply random text\",\n  \"isRead\": false,\n  \"createdAt\": \"2023-01-28T23:27:24.728Z\",\n  \"updatedAt\": \"2023-01-30T14:18:20.741Z\",\n  \"__v\": 0\n}\n\n```\n\n### 4\\. Mark Message as Read\n\n- **URL** : `/api/messages/:id`\n- **Method** : `PATCH`\n- **Auth Required** : `True`\n- **Permissions Required** : `None`\n    \n\n**Sample Request**\n\n``` json\nhttp://localhost:4000/api/messages/63d5af5c68ddff00fe86750c\nBODY\n{\n    \"isRead\": true\n}\n\n```\n\n**Sample Response**\n\n```\njsonCopy codeHTTP/1.1 200 OK\n{\n  \"_id\": \"63d5af5c68ddff00fe86750c\",\n  \"subject\": \"Homework Submission\",\n  \"content\": \"Contrary to popular belief, Lorem Ipsum is not simply random text\",\n  \"isRead\": true,\n  \"createdAt\": \"2023-01-28T23:27:24.728Z\",\n  \"updatedAt\": \"2023-01-30T14:18:20.741Z\",\n  \"__v\": 0\n}\n\n```\n\n## Error Responses\n\nThe API may return the following error responses:\n\n- `401 Unauthorized` if the request is not authorized\n- `404 Not Found` if the resource is not found\n- `500 Internal Server Error` if there is an error in the server while processing the request.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"25553859","collectionId":"abeac584-b656-4960-a0cd-4b166aab28a7","publishedId":"2s935isRVZ","public":true,"publicUrl":"https://documenter-api.postman.tech/view/25553859/2s935isRVZ","privateUrl":"https://go.postman.co/documentation/25553859-abeac584-b656-4960-a0cd-4b166aab28a7","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2023-01-31T01:29:17.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"backend mailbox","id":"dc8c9f54-8329-4e3e-931b-ba63fb560eaf","owner":"25553859","values":[{"key":"PORT","value":"","enabled":true,"type":"default"},{"key":"MONGO_URI","value":"mongodb+srv://tascha:MERN1234567@clustermailbox.yhsfwmm.mongodb.net/?retryWrites=true&w=majority","enabled":true,"type":"secret"},{"key":"SECRET","value":"aotxxzsjfkddwqbncdhpeLgfuuiuyuyheswlind","enabled":true,"type":"secret"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"backend mailbox","value":"25553859-dc8c9f54-8329-4e3e-931b-ba63fb560eaf"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/2s935isRVZ"}