From acf83d15840e9cced0b1eed3d218c48c9bae48da Mon Sep 17 00:00:00 2001 From: Shakira Date: Sat, 24 Aug 2024 10:36:53 +0300 Subject: [PATCH] Add golang backend postman collection --- ...imikoGolangSwagger.postman_collection.json | 25102 ++++++++++++++++ 1 file changed, 25102 insertions(+) create mode 100644 status/postman/KimikoGolangSwagger.postman_collection.json diff --git a/status/postman/KimikoGolangSwagger.postman_collection.json b/status/postman/KimikoGolangSwagger.postman_collection.json new file mode 100644 index 0000000..6c691ad --- /dev/null +++ b/status/postman/KimikoGolangSwagger.postman_collection.json @@ -0,0 +1,25102 @@ +{ + "info": { + "_postman_id": "148180a1-2110-4f18-adc2-90ab45923f92", + "name": "Kimiko Golang Swagger", + "description": "This API provides functionalities for user management, organisation management, authentication, messaging, payments, and various other services.\nIt includes features like social authentication, email notifications, payment integrations with Stripe and Flutterwave, and comprehensive user and organisation management.\n\nContact Support:\n Email: support@example.com", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "37864089", + "_collection_link": "https://solar-shadow-861340.postman.co/workspace/Boilerplate-APIs-~4739b6f1-a5f1-4849-ae82-41f5c0e356e1/collection/37864089-148180a1-2110-4f18-adc2-90ab45923f92?action=share&source=collection_link&creator=37864089" + }, + "item": [ + { + "name": "auth", + "item": [ + { + "name": "register", + "item": [ + { + "name": "Register a new user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Check if the status code is 201 (User registered successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "// Validate response time", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "// Verify correct message", + "pm.test(\"Response has correct message\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.message).to.eql(\"user created successfully\");", + " pm.expect(jsonData.status_code).to.eql(201);", + "});", + "// Verify correct response body", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData).to.have.property(\"data\");", + " pm.expect(jsonData).to.have.property(\"message\");", + " pm.expect(jsonData).to.have.property(\"status_code\");", + "});", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "", + "// Function to generate a random phone number", + "function randomPhone() {", + " return `${Math.floor(Math.random() * 9000000000) + 1000000000}`;", + "}", + "", + "// Generate random email", + "pm.environment.set(\"randomEmail\", `trendy${Math.floor(Math.random() * 100000)}@email.com`);", + "// Generate random username", + "pm.environment.set(\"randomUsername\", `Doe${Math.floor(Math.random() * 10000)}`);", + "// Generate random first name", + "const firstNames = [\"Larry\", \"John\", \"Jane\", \"Lisa\", \"Mark\"];", + "pm.environment.set(\"randomFirstName\", firstNames[Math.floor(Math.random() * firstNames.length)]);", + "// Generate random last name", + "const lastNames = [\"Shein\", \"Doe\", \"Smith\", \"Brown\", \"Johnson\"];", + "pm.environment.set(\"randomLastName\", lastNames[Math.floor(Math.random() * lastNames.length)]);", + "// Set random password", + "pm.environment.set(\"randomPassword\", `Test${Math.floor(Math.random() * 100)}#${Math.floor(Math.random() * 100)}`)", + "pm.environment.set('randomPhone', randomPhone());", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"{{randomUserName}}\",\n \"email\": \"{{randomEmail}}\",\n \"password\": \"{{randomPassword}}\",\n \"first_name\": \"{{randomFirstName}}\",\n \"last_name\": \"{{randomLastName}}\",\n \"phone_number\": \"{{randomPhone}}\"\n}\n", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/register", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "response": [ + { + "name": "User registered successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"phone_number\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/register", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"role\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"username\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\",\n \"access_token\": \"\",\n \"expires_at\": \"\"\n }\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"phone_number\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/register", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessed Entity", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"\",\n \"email\": \"\",\n \"password\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"phone_number\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/register", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "register" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "login", + "item": [ + { + "name": "Authenticate a user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (User login successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response has the correct message", + "pm.test(\"Response has correct message\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.message).to.eql(\"Login Successfully\");", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.data).to.have.property(\"user\");", + " pm.expect(jsonData.data).to.have.property(\"access_token\");", + "});", + "", + "// Test if the access token is valid and save it to the collection variable", + "pm.test(\"Access token is valid\", function () {", + " const jsonData = pm.response.json();", + " const token = jsonData.data.access_token;", + " ", + " pm.expect(token).to.be.a(\"string\");", + "", + " // Save the token in the collection's collaborative environment", + " pm.collectionVariables.set(\"bearerToken\", token);", + " pm.test(\"Bearer token is set in collection\", function () {", + " pm.expect(pm.collectionVariables.get(\"bearerToken\")).to.eql(token);", + " });", + "});", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const storedEmail = pm.environment.get(\"randomEmail\");", + "const storedPassword = pm.environment.get(\"randomPassword\");", + "pm.environment.set(\"loginEmail\", storedEmail);", + "pm.environment.set(\"loginPassword\", storedPassword);" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"{{loginEmail}}\",\n \"password\": \"{{loginPassword}}\"\n}\n", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/login", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [ + { + "name": "User login successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\",\n \"password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/login", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"role\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"username\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\",\n \"access_token\": \"\",\n \"expires_at\": \"\"\n }\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\",\n \"password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/login", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessed Entity", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\",\n \"password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/login", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "logout", + "item": [ + { + "name": "logout a user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Check if the status code is 200 (User logged out successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Validate response time", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Validate the response structure", + "pm.test(\"Response has correct structure\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData).to.have.property(\"status_code\", 200);", + " pm.expect(jsonData).to.have.property(\"message\", \"user logout successfully\");", + "});", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/auth/logout", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "logout" + ] + } + }, + "response": [ + { + "name": "User logout successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/auth/logout", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "logout" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {}\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/auth/logout", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "logout" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/auth/logout", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "logout" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "google", + "item": [ + { + "name": "Endpoint for callback from frontend with token gotten from google oauth provider", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/google", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "google" + ] + } + }, + "response": [ + { + "name": "user sign in succesfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/google", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "google" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {\n \"access_token\": \"\",\n \"user\": {\n \"id\": \"\",\n \"email\": \"\",\n \"fullname\": \"\",\n \"avatar_url\": \"\",\n \"expires_in\": \"\",\n \"role\": \"\"\n }\n }\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/google", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "google" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/google", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "google" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessed Entity", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/google", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "google" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "facebook", + "item": [ + { + "name": "Endpoint for callback from frontend with token gotten from google oauth provider", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/facebook", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "facebook" + ] + } + }, + "response": [ + { + "name": "user sign in succesfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/facebook", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "facebook" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {\n \"access_token\": \"\",\n \"user\": {\n \"id\": \"\",\n \"email\": \"\",\n \"fullname\": \"\",\n \"avatar_url\": \"\",\n \"expires_in\": \"\",\n \"role\": \"\"\n }\n }\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/facebook", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "facebook" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/facebook", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "facebook" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessed Entity", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id_token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/facebook", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "facebook" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "change-password", + "item": [ + { + "name": "Verify the password reset token and set a new password", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "const oldPassword = pm.environment.get(\"randomPassword\");", + "const newPassword = `NewTest${Math.floor(Math.random() * 100)}#${Math.floor(Math.random() * 100)}`;", + "", + "pm.environment.set(\"oldPassword\", oldPassword);", + "pm.environment.set(\"newPassword\", newPassword);", + "", + "// Update the stored password for future use", + "pm.environment.set(\"randomPassword\", newPassword);", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Check if the status code is 200 (User changed password successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Validate response time", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Validate the response structure", + "pm.test(\"Response has correct structure\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData).to.have.property(\"status_code\", 200);", + "});", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"old_password\": \"{{oldPassword}}\",\n \"new_password\": \"{{newPassword}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/change-password", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "change-password" + ] + } + }, + "response": [ + { + "name": "Password updated successfully", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"old_password\": \"\",\n \"new_password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/change-password", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "change-password" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\"\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"old_password\": \"\",\n \"new_password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/change-password", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "change-password" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"old_password\": \"\",\n \"new_password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/change-password", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "change-password" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessed Entity", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"old_password\": \"\",\n \"new_password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/change-password", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "change-password" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "magick-link", + "item": [ + { + "name": "verify", + "item": [ + { + "name": "Verify the magic link token", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link", + "verify" + ] + } + }, + "response": [ + { + "name": "Token verified successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link", + "verify" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statusCode\": \"\",\n \"message\": \"\",\n \"data\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"role\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"username\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\",\n \"access_token\": \"\",\n \"expires_at\": \"\"\n }\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link", + "verify" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link", + "verify" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link", + "verify" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Request a magic link for authentication", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random email", + "pm.environment.set(\"randomEmail\", `trendy${Math.floor(Math.random() * 100000)}@email.com`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Check if the status code is 200 (User magic link sent successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Validate response time", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Validate the response structure", + "pm.test(\"Response has correct structure\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData).to.have.property(\"status_code\", 200);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"{{randomEmail}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link" + ] + }, + "description": "Uses Cases: \n - Sign up a new user\n - Sign in an existing user\n - Sign in with auto sign-up a new user if not exists" + }, + "response": [ + { + "name": "Magic link sent successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"statusCode\": \"\"\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/magick-link", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "magick-link" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "password-reset", + "item": [ + { + "name": "verify", + "item": [ + { + "name": "Verify the password reset token and set a new password", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\",\n \"new_password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset", + "verify" + ] + } + }, + "response": [ + { + "name": "Password reset successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\",\n \"new_password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset", + "verify" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"statusCode\": \"\"\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\",\n \"new_password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset", + "verify" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\",\n \"new_password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset", + "verify" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\",\n \"new_password\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset", + "verify" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Request a password reset link", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "const storedEmail = pm.environment.get(\"randomEmail\");", + "const storedPassword = pm.environment.get(\"randomPassword\");", + "", + "pm.environment.set(\"loginEmail\", storedEmail);", + "pm.environment.set(\"loginPassword\", storedPassword);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Check if the status code is 200 (User password reset successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Validate response time", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Validate the response structure", + "pm.test(\"Response has correct structure\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData).to.have.property(\"status_code\", 200);", + " pm.expect(jsonData).to.have.property(\"message\", \"Password reset email sent\");", + "});", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"{{loginEmail}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset" + ] + } + }, + "response": [ + { + "name": "Password reset link sent successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"statusCode\": \"\"\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/password-reset", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "password-reset" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "2fa", + "item": [ + { + "name": "enable", + "item": [ + { + "name": "Enable two-factor authentication", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Check if the status code is 201 (User enabled 2fa successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Validate response time", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Validate the response structure", + "pm.test(\"Response has correct structure\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData).to.have.property(\"status_code\", 201);", + "});", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/auth/2fa/enable", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "2fa", + "enable" + ] + } + }, + "response": [ + { + "name": "Two-factor authentication enabled successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/auth/2fa/enable", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "2fa", + "enable" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"statusCode\": \"\",\n \"data\": {\n \"secret\": \"\",\n \"qr_code\": \"\"\n }\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/auth/2fa/enable", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "2fa", + "enable" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "verify", + "item": [ + { + "name": "Verify two-factor authentication", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Verify 2FA subscription created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/2fa/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "2fa", + "verify" + ] + } + }, + "response": [ + { + "name": "Token verified successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/2fa/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "2fa", + "verify" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statusCode\": \"\",\n \"message\": \"\",\n \"data\": {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"role\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"username\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\",\n \"access_token\": \"\",\n \"expires_at\": \"\"\n }\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/2fa/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "2fa", + "verify" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/2fa/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "2fa", + "verify" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"token\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/2fa/verify", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "2fa", + "verify" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + } + ] + }, + { + "name": "users", + "item": [ + { + "name": "{userId}", + "item": [ + { + "name": "role", + "item": [ + { + "name": "{roleId}", + "item": [ + { + "name": "Assign user to another role", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/role/:roleId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "role", + ":roleId" + ], + "variable": [ + { + "key": "userId", + "value": "01917cb3-ec54-7e76-a66c-12052683b48f", + "description": "(Required) " + }, + { + "key": "roleId", + "value": "01917cb3-ec54-7e76-a66c-12052683b48f", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Role updated successfully", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/role/:roleId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "role", + ":roleId" + ], + "variable": [ + { + "key": "userId" + }, + { + "key": "roleId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/role/:roleId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "role", + ":roleId" + ], + "variable": [ + { + "key": "userId" + }, + { + "key": "roleId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/role/:roleId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "role", + ":roleId" + ], + "variable": [ + { + "key": "userId" + }, + { + "key": "roleId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/role/:roleId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "role", + ":roleId" + ], + "variable": [ + { + "key": "userId" + }, + { + "key": "roleId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "regions", + "item": [ + { + "name": "Get user region", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId", + "value": "", + "description": "(Required) ID of the user to retrieve the region information for." + } + ] + }, + "description": "Retrieves the region information for a specific user." + }, + "response": [ + { + "name": "User region retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"userId\": \"\",\n \"region_id\": \"\",\n \"timezone_id\": \"\",\n \"language_id\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Update user region", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"region_id\": \"\",\n \"timezone_id\": \"\",\n \"language_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId", + "value": "", + "description": "(Required) ID of the user to update the region for." + } + ] + }, + "description": "Updates the region for a specific user." + }, + "response": [ + { + "name": "User region updated successfully", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"region_id\": \"\",\n \"timezone_id\": \"\",\n \"language_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"region_id\": \"\",\n \"timezone_id\": \"\",\n \"language_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"region_id\": \"\",\n \"timezone_id\": \"\",\n \"language_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"region_id\": \"\",\n \"timezone_id\": \"\",\n \"language_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"region_id\": \"\",\n \"timezone_id\": \"\",\n \"language_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "regions" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "data-privacy-settings", + "item": [ + { + "name": "Get user data privacy settings", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId", + "value": "", + "description": "(Required) ID of the user to retrieve the data privacy information for." + } + ] + }, + "description": "Retrieves the data privacy information for a specific user." + }, + "response": [ + { + "name": "User data privacy settings retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"user_id\": \"\",\n \"profile_visibility\": \"\",\n \"share_data_with_partners\": \"\",\n \"receive_email_updates\": \"\",\n \"enable_2fa\": \"\",\n \"use_data_encryption\": \"\",\n \"allow_analytics\": \"\",\n \"personalized_ads\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Update user data privacy settings", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"profile_visibility\": \"\",\n \"share_data_with_partners\": \"\",\n \"receive_email_updates\": \"\",\n \"enable_2fa\": \"\",\n \"use_data_encryption\": \"\",\n \"allow_analytics\": \"\",\n \"personalized_ads\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId", + "value": "", + "description": "(Required) ID of the user to update the data privacy info for." + } + ] + }, + "description": "Updates the data privacy settings for a specific user." + }, + "response": [ + { + "name": "User data privacy updated successfully", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"profile_visibility\": \"\",\n \"share_data_with_partners\": \"\",\n \"receive_email_updates\": \"\",\n \"enable_2fa\": \"\",\n \"use_data_encryption\": \"\",\n \"allow_analytics\": \"\",\n \"personalized_ads\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"user_id\": \"\",\n \"profile_visibility\": \"\",\n \"share_data_with_partners\": \"\",\n \"receive_email_updates\": \"\",\n \"enable_2fa\": \"\",\n \"use_data_encryption\": \"\",\n \"allow_analytics\": \"\",\n \"personalized_ads\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"profile_visibility\": \"\",\n \"share_data_with_partners\": \"\",\n \"receive_email_updates\": \"\",\n \"enable_2fa\": \"\",\n \"use_data_encryption\": \"\",\n \"allow_analytics\": \"\",\n \"personalized_ads\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"profile_visibility\": \"\",\n \"share_data_with_partners\": \"\",\n \"receive_email_updates\": \"\",\n \"enable_2fa\": \"\",\n \"use_data_encryption\": \"\",\n \"allow_analytics\": \"\",\n \"personalized_ads\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"profile_visibility\": \"\",\n \"share_data_with_partners\": \"\",\n \"receive_email_updates\": \"\",\n \"enable_2fa\": \"\",\n \"use_data_encryption\": \"\",\n \"allow_analytics\": \"\",\n \"personalized_ads\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"profile_visibility\": \"\",\n \"share_data_with_partners\": \"\",\n \"receive_email_updates\": \"\",\n \"enable_2fa\": \"\",\n \"use_data_encryption\": \"\",\n \"allow_analytics\": \"\",\n \"personalized_ads\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId/data-privacy-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId", + "data-privacy-settings" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Get user information", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId", + "value": "", + "description": "(Required) ID of the user" + } + ] + }, + "description": "Retrieves a user information." + }, + "response": [ + { + "name": "A user information", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"role\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"username\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\",\n \"access_token\": \"\",\n \"expires_at\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "User not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Update user info", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"language\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId", + "value": "", + "description": "(Required) ID of the user to update" + } + ] + }, + "description": "Updates the information of an existing user." + }, + "response": [ + { + "name": "User updated successfully", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"language\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"role\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"username\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\",\n \"access_token\": \"\",\n \"expires_at\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"language\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"language\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"language\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"language\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Delete a user", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId", + "value": "", + "description": "(Required) ID of the user to delete" + } + ] + }, + "description": "Deletes a user by their ID." + }, + "response": [ + { + "name": "User deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "User not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users/:userId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":userId" + ], + "variable": [ + { + "key": "userId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Get all users", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve users successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/users?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + }, + "description": "Retrieves a paginated list of users." + }, + "response": [ + { + "name": "A list of users", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"role\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"username\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\",\n \"access_token\": \"\",\n \"expires_at\": \"\"\n },\n {\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"role\": \"\",\n \"email\": \"\",\n \"phone\": \"\",\n \"username\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\",\n \"access_token\": \"\",\n \"expires_at\": \"\"\n }\n]" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/users?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "newsletter-subscription", + "item": [ + { + "name": "{Id}", + "item": [ + { + "name": "Delete a newsletter subscription", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + ":Id" + ], + "variable": [ + { + "key": "Id", + "value": "", + "description": "(Required) ID of the newsletter to delete" + } + ] + }, + "description": "Deletes a newsletter by its ID." + }, + "response": [ + { + "name": "newsletter deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + ":Id" + ], + "variable": [ + { + "key": "Id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + ":Id" + ], + "variable": [ + { + "key": "Id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Email not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + ":Id" + ], + "variable": [ + { + "key": "Id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + ":Id" + ], + "variable": [ + { + "key": "Id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "restore", + "item": [ + { + "name": "{Id}", + "item": [ + { + "name": "Restore a deleted newsletter email", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/restore/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + "restore", + ":Id" + ], + "variable": [ + { + "key": "Id", + "value": "", + "description": "(Required) ID of the newsletter to restore" + } + ] + }, + "description": "Restore a deleted newsletter email by its ID." + }, + "response": [ + { + "name": "Newsletter email restored successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/restore/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + "restore", + ":Id" + ], + "variable": [ + { + "key": "Id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/restore/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + "restore", + ":Id" + ], + "variable": [ + { + "key": "Id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Email not found", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/restore/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + "restore", + ":Id" + ], + "variable": [ + { + "key": "Id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/restore/:Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + "restore", + ":Id" + ], + "variable": [ + { + "key": "Id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "deleted", + "item": [ + { + "name": "Get all deleted newsletters emails", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/deleted?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + "deleted" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + }, + "description": "Retrieves a paginated list of deleted newsletters emails." + }, + "response": [ + { + "name": "A list of all deleted newsletters emails", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/deleted?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + "deleted" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"email\": \"\"\n },\n {\n \"email\": \"\"\n }\n]" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/deleted?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + "deleted" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription/deleted?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription", + "deleted" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Get all newsletters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve newsletter subscriptions successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + }, + "description": "Retrieves a paginated list of newsletters." + }, + "response": [ + { + "name": "A list of newsletters", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"email\": \"\"\n },\n {\n \"email\": \"\"\n }\n]" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/newsletter-subscription?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Add new email to newsletter", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random email", + "pm.environment.set(\"randomEmail\", `trendy${Math.floor(Math.random() * 100000)}@email.com`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Newsletter subscription created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201); ", + "});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"{{randomEmail}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/newsletter-subscription", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription" + ] + }, + "description": "Add a new email entry." + }, + "response": [ + { + "name": "Email added successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/newsletter-subscription", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/newsletter-subscription", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/newsletter-subscription", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/newsletter-subscription", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "newsletter-subscription" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "faq", + "item": [ + { + "name": "{faqId}", + "item": [ + { + "name": "Update an FAQ", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId", + "value": "", + "description": "(Required) ID of the FAQ to update" + } + ] + }, + "description": "Updates an existing FAQ." + }, + "response": [ + { + "name": "FAQ updated successfully", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "FAQ not found", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Delete a FAQ", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId", + "value": "", + "description": "(Required) ID of the FAQ to delete" + } + ] + }, + "description": "Deletes a FAQ by its ID." + }, + "response": [ + { + "name": "FAQ deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "FAQ not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/faq/:faqId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq", + ":faqId" + ], + "variable": [ + { + "key": "faqId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Get all FAQs", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve faq successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/faq?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + }, + "description": "Retrieves a paginated list of FAQs." + }, + "response": [ + { + "name": "A list of FAQs", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/faq?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n },\n {\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n }\n]" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/faq?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/faq?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Create a new FAQ", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random question", + "pm.environment.set(\"randomQuestion\", `Question${Math.floor(Math.random() * 100000)}`);", + "// Generate random answer", + "pm.environment.set(\"randomAnswer\", `Answer${Math.floor(Math.random() * 10000)}`);", + "// Generate random category", + "pm.environment.set(\"randomCategory\", `Category${Math.floor(Math.random() * 10000)}`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (FAQ created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"{{randomQuestion}}\",\n \"answer\": \"{{randomAnswer}}\",\n \"category\": \"{{randomCategory}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq" + ] + }, + "description": "Creates a new FAQ entry." + }, + "response": [ + { + "name": "FAQ created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"\",\n \"answer\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/faq", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "faq" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "languages", + "item": [ + { + "name": "Get all languages", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve languages successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/languages", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "languages" + ] + }, + "description": "Retrieves a list of all available languages." + }, + "response": [ + { + "name": "A list of languages", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/languages", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "languages" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"name\": \"\",\n \"code\": \"\"\n },\n {\n \"name\": \"\",\n \"code\": \"\"\n }\n]" + }, + { + "name": "Bad request error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/languages", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "languages" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/languages", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "languages" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Create a new language", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Language created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random name", + "pm.environment.set(\"randomName\", `Name${Math.floor(Math.random() * 100000)}`);", + "// Generate random code", + "pm.environment.set(\"randomCode\", `Code${Math.floor(Math.random() * 10000)}`);", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"{{randomName}}\",\n \"code\": \"{{randomCode}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/languages", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "languages" + ] + }, + "description": "Creates a new language entry." + }, + "response": [ + { + "name": "Language created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"code\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/languages", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "languages" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"code\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/languages", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "languages" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"code\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/languages", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "languages" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"code\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/languages", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "languages" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "timezones", + "item": [ + { + "name": "{id}", + "item": [ + { + "name": "Update a timezone", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones", + ":id" + ], + "variable": [ + { + "key": "id", + "value": "", + "description": "(Required) ID of the user to retrieve the region information for." + } + ] + }, + "description": "Update an existing timezone entry." + }, + "response": [ + { + "name": "Timezone updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Get all timezones", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve timezones successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/timezones", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones" + ] + }, + "description": "Retrieves a list of all available timezones." + }, + "response": [ + { + "name": "A list of timezones", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/timezones", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n },\n {\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n }\n]" + }, + { + "name": "Bad request error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/timezones", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/timezones", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Create a new timezone", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random timezone", + "pm.environment.set(\"randomTimezone\", `Timezone${Math.floor(Math.random() * 100000)}`);", + "// Generate random gmt", + "pm.environment.set(\"randomGMT\", `GMT${Math.floor(Math.random() * 10000)}`);", + "// Generate random description", + "pm.environment.set(\"randomDescription\", `Descrip${Math.floor(Math.random() * 10000)}`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Timezone created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"{{randomTimezone}}\",\n \"gmt_offset\": \"{{randomGMT}}\",\n \"description\": \"{{randomDescription}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones" + ] + }, + "description": "Creates a new timezone entry." + }, + "response": [ + { + "name": "Timezone created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"timezone\": \"\",\n \"gmt_offset\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/timezones", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "timezones" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "regions", + "item": [ + { + "name": "Get all regions", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve regions successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + }, + "description": "Retrieves a list of all available regions." + }, + "response": [ + { + "name": "A list of regions", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"name\": \"\",\n \"code\": \"\"\n },\n {\n \"name\": \"\",\n \"code\": \"\"\n }\n]" + }, + { + "name": "Bad request error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Create a new region", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random name", + "pm.environment.set(\"randomName\", `Name${Math.floor(Math.random() * 100000)}`);", + "// Generate random code", + "pm.environment.set(\"randomCode\", `Code${Math.floor(Math.random() * 10000)}`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Region created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"{{randomName}}\",\n \"code\": \"{{randomCode}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + }, + "description": "Creates a new region entry." + }, + "response": [ + { + "name": "Region created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"code\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"code\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"code\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"code\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"code\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/regions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "regions" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "waitlist", + "item": [ + { + "name": "Get all waitlist entries", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve waitlist entries successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/waitlist?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "waitlist" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + }, + "description": "Retrieves a paginated list of waitlist entries." + }, + "response": [ + { + "name": "A list of waitlist entries", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/waitlist?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "waitlist" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"name\": \"\",\n \"email\": \"\"\n },\n {\n \"name\": \"\",\n \"email\": \"\"\n }\n]" + }, + { + "name": "Bad request error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/waitlist?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "waitlist" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/waitlist?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "waitlist" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Add to waitlist", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random email", + "pm.environment.set(\"randomEmail\", `trendy${Math.floor(Math.random() * 100000)}@email.com`);", + "// Generate random name", + "pm.environment.set(\"randomName\", `Doe${Math.floor(Math.random() * 10000)}`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Waitlist created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"{{randomName}}\",\n \"email\": \"{{randomEmail}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/waitlist", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "waitlist" + ] + }, + "description": "Adds an entry to the waitlist." + }, + "response": [ + { + "name": "Waitlist entry created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/waitlist", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "waitlist" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/waitlist", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "waitlist" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/waitlist", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "waitlist" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/waitlist", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "waitlist" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "organisations", + "item": [ + { + "name": "{org_id}", + "item": [ + { + "name": "roles", + "item": [ + { + "name": "{role_id}", + "item": [ + { + "name": "permissions", + "item": [ + { + "name": "Update permissions for a specific role", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"category\": \"\",\n \"permission_list\": {\n \"commodo2e6\": \"\",\n \"non_9c\": \"\"\n }\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id/permissions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id", + "permissions" + ], + "variable": [ + { + "key": "org_id", + "value": "", + "description": "(Required) ID of the organization containing the role." + }, + { + "key": "role_id", + "value": "", + "description": "(Required) ID of the role to update permissions for." + } + ] + }, + "description": "Updates the permissions for a specific role within an organization." + }, + "response": [ + { + "name": "Permissions updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"category\": \"\",\n \"permission_list\": {\n \"commodo2e6\": \"\",\n \"non_9c\": \"\"\n }\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id/permissions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id", + "permissions" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"category\": \"\",\n \"permission_list\": {\n \"commodo2e6\": \"\",\n \"non_9c\": \"\"\n }\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id/permissions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id", + "permissions" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"category\": \"\",\n \"permission_list\": {\n \"commodo2e6\": \"\",\n \"non_9c\": \"\"\n }\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id/permissions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id", + "permissions" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Forbidden", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"category\": \"\",\n \"permission_list\": {\n \"commodo2e6\": \"\",\n \"non_9c\": \"\"\n }\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id/permissions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id", + "permissions" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Forbidden", + "code": 403, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"category\": \"\",\n \"permission_list\": {\n \"commodo2e6\": \"\",\n \"non_9c\": \"\"\n }\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id/permissions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id", + "permissions" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Retrieve a specific organization role", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id", + "value": "", + "description": "(Required) ID of the organization containing the role." + }, + { + "key": "role_id", + "value": "", + "description": "(Required) ID of the role to retrieve." + } + ] + }, + "description": "Retrieves detailed information about a specific role within an organization." + }, + "response": [ + { + "name": "Role retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"organization_id\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Update a specific organization role", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id", + "value": "", + "description": "(Required) ID of the organization containing the role." + }, + { + "key": "role_id", + "value": "", + "description": "(Required) ID of the role to update." + } + ] + }, + "description": "Updates the details of a specific role within an organization." + }, + "response": [ + { + "name": "Role updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Forbidden", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Forbidden", + "code": 403, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Delete a specific organization role", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id", + "value": "", + "description": "(Required) ID of the organization containing the role." + }, + { + "key": "role_id", + "value": "", + "description": "(Required) ID of the role to delete." + } + ] + }, + "description": "Deletes a specific role within an organization." + }, + "response": [ + { + "name": "Role deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Forbidden", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Forbidden", + "code": 403, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles/:role_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles", + ":role_id" + ], + "variable": [ + { + "key": "org_id" + }, + { + "key": "role_id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Create a new organization role", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id", + "value": "", + "description": "(Required) ID of the organization to create the role in." + } + ] + }, + "description": "Creates a new role within an organization." + }, + "response": [ + { + "name": "Role created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Forbidden", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "Forbidden", + "code": 403, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Retrieve a list of organization roles", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id", + "value": "", + "description": "(Required) ID of the organization to retrieve roles for." + } + ] + }, + "description": "Retrieves a list of roles within an organization." + }, + "response": [ + { + "name": "Roles retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"roles\": [\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"organization_id\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"organization_id\": \"\"\n }\n ]\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:org_id/roles", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":org_id", + "roles" + ], + "variable": [ + { + "key": "org_id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "{orgId}", + "item": [ + { + "name": "users", + "item": [ + { + "name": "add a user to an organization by superadmin", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"userId\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId", + "value": "", + "description": "(Required) " + } + ] + }, + "description": "adds a user to an organization" + }, + "response": [ + { + "name": "User added successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"userId\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"userId\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"userId\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"userId\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"userId\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Get users in an organization", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Users retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": [\n {\n \"id\": \"\",\n \"email\": \"\",\n \"phone_number\": \"\",\n \"name\": \"\"\n },\n {\n \"id\": \"\",\n \"email\": \"\",\n \"phone_number\": \"\",\n \"name\": \"\"\n }\n ]\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId", + "users" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "update an organization", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId", + "value": "", + "description": "(Required) " + } + ] + }, + "description": "updates an organization" + }, + "response": [ + { + "name": "organization updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"organisation_id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "retrieve an organization", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId", + "value": "", + "description": "(Required) " + } + ] + }, + "description": "retrieve an organization" + }, + "response": [ + { + "name": "organization retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"organisation_id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Delete an organisation by id", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Organisations deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "No Content", + "code": 204, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Invalid orgId format", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Forbidden", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Forbidden", + "code": 403, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Internal server error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations/:orgId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations", + ":orgId" + ], + "variable": [ + { + "key": "orgId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "create an organization", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random name", + "pm.environment.set(\"randomName\", `name${Math.floor(Math.random() * 10000)}`);", + "// Generate random description", + "pm.environment.set(\"randomDescription\", `description${Math.floor(Math.random() * 10000)}`);", + "", + "// Generate random email", + "pm.environment.set(\"randomEmail\", `trendy${Math.floor(Math.random() * 100000)}@email.com`);", + "", + "// Generate random state", + "pm.environment.set(\"randomState\", `State${Math.floor(Math.random() * 10000)}`);", + "// Generate random industry", + "pm.environment.set(\"randomIndustry\", `Industry${Math.floor(Math.random() * 10000)}`);", + "// Generate random type", + "pm.environment.set(\"randomType\", `Type${Math.floor(Math.random() * 10000)}`);", + "// Generate random address", + "pm.environment.set(\"randomAddress\", `Address${Math.floor(Math.random() * 10000)}`);", + "// Set random category", + "pm.environment.set(\"randomCountry\", `Country${Math.floor(Math.random() * 10000)}`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Organisation created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"{{randomName}}\",\n \"description\": \"{{randomDescription}}\",\n \"email\": \"{{randomEmail}}\",\n \"state\": \"{{randomState}}\",\n \"industry\": \"{{randomIndustry}}\",\n \"type\": \"{{randomType}}\",\n \"address\": \"{{randomAddress}}\",\n \"country\": \"{{randomCountry}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + }, + "description": "creates an organization" + }, + "response": [ + { + "name": "organization created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"organisation_id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"email\": \"\",\n \"state\": \"\",\n \"industry\": \"\",\n \"type\": \"\",\n \"address\": \"\",\n \"country\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Query organisations where a user belongs", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve organisations successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + }, + "description": "Retrieves a list of organisations where the specified user belongs." + }, + "response": [ + { + "name": "A list of organisations", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n]" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "User not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/organisations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "organisations" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "jobs", + "item": [ + { + "name": "{job_id}", + "item": [ + { + "name": "Fetch a job post by ID", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id", + "value": "", + "description": "(Required) The ID of the job post to fetch" + } + ] + }, + "description": "Fetches the details of a job post by its ID." + }, + "response": [ + { + "name": "Job post fetched successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"how_to_apply\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Invalid ID format", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Job not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Failed to fetch job post", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Update a job post by ID", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id", + "value": "", + "description": "(Required) The ID of the job post to update" + } + ] + }, + "description": "Updates the details of an existing job post." + }, + "response": [ + { + "name": "Job post updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"how_to_apply\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Invalid ID format", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Job post not found", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Failed to update job post", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Delete a job post by ID", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id", + "value": "", + "description": "(Required) The ID of the job post to delete" + } + ] + }, + "description": "Deletes a job post by its ID." + }, + "response": [ + { + "name": "No content", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "No Content", + "code": 204, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Invalid ID format", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Job post not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Failed to delete job post", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/:job_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + ":job_id" + ], + "variable": [ + { + "key": "job_id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Fetch all job posts", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve jobs successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs?page=&limit=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs" + ], + "query": [ + { + "key": "page", + "value": "", + "description": "The page number for pagination" + }, + { + "key": "limit", + "value": "", + "description": "The number of items per page" + } + ] + }, + "description": "Fetches all job posts with optional pagination." + }, + "response": [ + { + "name": "A list of paginated job posts", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs?page=&limit=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs" + ], + "query": [ + { + "key": "page", + "value": "", + "description": "The page number for pagination" + }, + { + "key": "limit", + "value": "", + "description": "The number of items per page" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"id\": \"\",\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"how_to_apply\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n },\n {\n \"id\": \"\",\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"how_to_apply\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n]" + }, + { + "name": "Jobs not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs?page=&limit=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs" + ], + "query": [ + { + "key": "page", + "value": "", + "description": "The page number for pagination" + }, + { + "key": "limit", + "value": "", + "description": "The number of items per page" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Create a new job post", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/jobs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs" + ] + }, + "description": "Creates a new job post with the provided details." + }, + "response": [ + { + "name": "Job post created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/jobs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"how_to_apply\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/jobs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Failed to create job post", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"salary_range\": \"\",\n \"job_type\": \"\",\n \"location\": \"\",\n \"deadline\": \"\",\n \"job_mode\": \"\",\n \"experience_level\": \"\",\n \"benefits\": \"\",\n \"company_name\": \"\",\n \"description\": \"\",\n \"key_responsibilities\": \"\",\n \"qualifications\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/jobs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "blogs", + "item": [ + { + "name": "{blogId}", + "item": [ + { + "name": "retrieve a single blog post", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Successful response", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"image_url\": \"\",\n \"category\": \"\",\n \"author\": \"\",\n \"author_id\": \"\",\n \"created_at\": \"\"\n }\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Delete a blog by admin", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "blog deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "No Content", + "code": 204, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Invalid orgId format", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Forbidden", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Forbidden", + "code": 403, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Internal server error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "edit", + "item": [ + { + "name": "{blogId}", + "item": [ + { + "name": "update a blog post by a superadmin", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs/edit/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + "edit", + ":blogId" + ], + "variable": [ + { + "key": "blogId", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Blog post updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs/edit/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + "edit", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"image_url\": \"\",\n \"category\": \"\",\n \"author\": \"\",\n \"author_id\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs/edit/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + "edit", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs/edit/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + "edit", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs/edit/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + "edit", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs/edit/:blogId", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs", + "edit", + ":blogId" + ], + "variable": [ + { + "key": "blogId" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "create a blog post by a superadmin", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs" + ] + } + }, + "response": [ + { + "name": "Blog post created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"image_url\": \"\",\n \"category\": \"\",\n \"author\": \"\",\n \"author_id\": \"\",\n \"created_at\": \"\"\n }\n}" + }, + { + "name": "Bad request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not found", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs" + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\",\n \"category\": \"\",\n \"image_url\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/blogs", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "get all blogs from the lastest", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs?page=&limit=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs" + ], + "query": [ + { + "key": "page", + "value": "", + "description": "The page number for pagination" + }, + { + "key": "limit", + "value": "", + "description": "The number of items per page" + } + ] + } + }, + "response": [ + { + "name": "A list of all blogs", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs?page=&limit=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs" + ], + "query": [ + { + "key": "page", + "value": "", + "description": "The page number for pagination" + }, + { + "key": "limit", + "value": "", + "description": "The number of items per page" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": [\n {\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"image_url\": \"\",\n \"category\": \"\",\n \"author\": \"\",\n \"author_id\": \"\",\n \"created_at\": \"\"\n },\n {\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"image_url\": \"\",\n \"category\": \"\",\n \"author\": \"\",\n \"author_id\": \"\",\n \"created_at\": \"\"\n }\n ]\n}" + }, + { + "name": "Failed to fetch all blogs", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/blogs?page=&limit=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "blogs" + ], + "query": [ + { + "key": "page", + "value": "", + "description": "The page number for pagination" + }, + { + "key": "limit", + "value": "", + "description": "The number of items per page" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "squeeze", + "item": [ + { + "name": "Create a squeeze record", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "", + "// Function to generate a random phone number", + "function randomPhone() {", + " return `${Math.floor(Math.random() * 9000000000) + 1000000000}`;", + "}", + "", + "// Generate random email", + "pm.environment.set(\"randomEmail\", `trendy${Math.floor(Math.random() * 100000)}@email.com`);", + "// Generate random first name", + "const firstNames = [\"Larry\", \"John\", \"Jane\", \"Lisa\", \"Mark\"];", + "pm.environment.set(\"randomFirstName\", firstNames[Math.floor(Math.random() * firstNames.length)]);", + "// Generate random last name", + "const lastNames = [\"Kira\", \"Lila\", \"John\", \"Lool\", \"Pait\"];", + "pm.environment.set(\"randomLastName\", lastNames[Math.floor(Math.random() * lastNames.length)]);", + "//Generate random phone number", + "pm.environment.set('randomPhoneNumber', randomPhone());", + "//Generate random location", + "pm.environment.set(\"randomLocation\", `Loca${Math.floor(Math.random() * 10000)}`);", + "// Generate random job title", + "pm.environment.set(\"randomJobTitle\", `Job${Math.floor(Math.random() * 10000)}`);", + "// Generate random company", + "pm.environment.set(\"randomCompany\", `Comp${Math.floor(Math.random() * 10000)}`);", + "// Generate random interests", + "pm.environment.set(\"randomInterests\", `Inter${Math.floor(Math.random() * 10000)}`);", + "// Generate random referral cource", + "pm.environment.set(\"randomReferral\", `Referral${Math.floor(Math.random() * 10000)}`);", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Squeeze created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + " pm.expect(jsonData.message).to.eql(\"Testimonial created successfully\");", + " ", + "", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"{{randomEmail}}\",\n \"first_name\": \"{{randomFirstName}}\",\n \"last_name\": \"{{randomLastName}}\",\n \"phone\": \"{{randomPhoneNumber}}\",\n \"location\": \"{{randomLocation}}\",\n \"job_title\": \"{{randomJobTitle}}\",\n \"company\": \"{{randomCompany}}\",\n \"interests\": \"{{randomInterests}}\",\n \"referral_source\": \"{{randomReferral}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/squeeze", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "squeeze" + ] + }, + "description": "creates a new squeeze record" + }, + "response": [ + { + "name": "Successfully created the resource", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"phone\": \"\",\n \"location\": \"\",\n \"job_title\": \"\",\n \"company\": \"\",\n \"interests\": [\n \"\",\n \"\"\n ],\n \"referral_source\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/squeeze", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "squeeze" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"phone\": \"\",\n \"location\": \"\",\n \"job_title\": \"\",\n \"company\": \"\",\n \"interests\": [\n \"\",\n \"\"\n ],\n \"referral_source\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"phone\": \"\",\n \"location\": \"\",\n \"job_title\": \"\",\n \"company\": \"\",\n \"interests\": [\n \"\",\n \"\"\n ],\n \"referral_source\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/squeeze", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "squeeze" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"phone\": \"\",\n \"location\": \"\",\n \"job_title\": \"\",\n \"company\": \"\",\n \"interests\": [\n \"\",\n \"\"\n ],\n \"referral_source\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/squeeze", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "squeeze" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "testimonials", + "item": [ + { + "name": "Create a new testimonial", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random name", + "pm.environment.set(\"randomUsername\", `Doe${Math.floor(Math.random() * 10000)}`);", + "// Generate random content", + "pm.environment.set(\"randomContent\", `Content${Math.floor(Math.random() * 10000)}`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Testimonial created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + " pm.expect(jsonData.message).to.eql(\"Testimonial created successfully\");", + " ", + "", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"{{randomName}}\",\n \"content\": \"{{randomContent}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/testimonials", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "testimonials" + ] + }, + "description": "Creates a new testimonial." + }, + "response": [ + { + "name": "Testimonial created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/testimonials", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "testimonials" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"user_id\": \"\",\n \"name\": \"\",\n \"content\": \"\",\n \"created_at\": \"\"\n }\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/testimonials", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "testimonials" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/testimonials", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "testimonials" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/testimonials", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "testimonials" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "products", + "item": [ + { + "name": "{product_id}", + "item": [ + { + "name": "Get a product", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id", + "value": "", + "description": "(Required) " + } + ] + }, + "description": "Get a product entry." + }, + "response": [ + { + "name": "Product retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not Found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Delete a product", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id", + "value": "", + "description": "(Required) " + } + ] + }, + "description": "Deletes a product entry." + }, + "response": [ + { + "name": "Product deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "categories", + "item": [ + { + "name": "{category}", + "item": [ + { + "name": "Get products by category", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/categories/:category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "categories", + ":category" + ], + "variable": [ + { + "key": "category", + "value": "", + "description": "(Required) " + } + ] + }, + "description": "Get products by category." + }, + "response": [ + { + "name": "Products retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/categories/:category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "categories", + ":category" + ], + "variable": [ + { + "key": "category" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"products\": [\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n }\n ]\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/categories/:category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "categories", + ":category" + ], + "variable": [ + { + "key": "category" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/categories/:category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "categories", + ":category" + ], + "variable": [ + { + "key": "category" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not Found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/categories/:category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "categories", + ":category" + ], + "variable": [ + { + "key": "category" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/categories/:category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "categories", + ":category" + ], + "variable": [ + { + "key": "category" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "filter", + "item": [ + { + "name": "Filter products", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/filter?category=&price=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "filter" + ], + "query": [ + { + "key": "category", + "value": "" + }, + { + "key": "price", + "value": "" + } + ] + }, + "description": "Filter products by category and price." + }, + "response": [ + { + "name": "Products retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/filter?category=&price=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "filter" + ], + "query": [ + { + "key": "category", + "value": "" + }, + { + "key": "price", + "value": "" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"products\": [\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n }\n ]\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/filter?category=&price=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "filter" + ], + "query": [ + { + "key": "category", + "value": "" + }, + { + "key": "price", + "value": "" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/filter?category=&price=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "filter" + ], + "query": [ + { + "key": "category", + "value": "" + }, + { + "key": "price", + "value": "" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not Found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/filter?category=&price=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "filter" + ], + "query": [ + { + "key": "category", + "value": "" + }, + { + "key": "price", + "value": "" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products/filter?category=&price=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "filter" + ], + "query": [ + { + "key": "category", + "value": "" + }, + { + "key": "price", + "value": "" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "image", + "item": [ + { + "name": "{product_id}", + "item": [ + { + "name": "Update a product image", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"image\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products/image/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "image", + ":product_id" + ], + "variable": [ + { + "key": "product_id", + "value": "", + "description": "(Required) " + } + ] + }, + "description": "Updates a product image." + }, + "response": [ + { + "name": "Product image updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"image\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products/image/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "image", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"image\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products/image/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "image", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"image\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products/image/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "image", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not Found", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"image\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products/image/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "image", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"image\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products/image/:product_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "image", + ":product_id" + ], + "variable": [ + { + "key": "product_id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "Create a new product", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Products created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + " pm.expect(jsonData.message).to.eql(\"Product created successfully\");", + " ", + "", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random name", + "pm.environment.set(\"randomName\", `name${Math.floor(Math.random() * 10000)}`);", + "// Generate random description", + "pm.environment.set(\"randomDescription\", `description${Math.floor(Math.random() * 10000)}`);", + "// Generate random price", + "pm.environment.set(\"randomPrice\", `${Math.floor(Math.random() * 10000)}`);", + "// Generate random stock", + "pm.environment.set(\"randomStock\", `${Math.floor(Math.random() * 10000)}`);", + "// Set random category", + "pm.environment.set(\"randomCategory\", `category${Math.floor(Math.random() * 10000)}`);" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"{{randomName}}\",\n \"description\": \"{{randomDescription}}\",\n \"price\": \"{{randomPrice}}\",\n \"stock\": \"{{randomStock}}\",\n \"category\": \"{{randomCategory}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + }, + "description": "Creates a new product entry." + }, + "response": [ + { + "name": "Product created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Update a product", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + }, + "description": "Updates a product entry." + }, + "response": [ + { + "name": "Product updated successfully", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Get all products", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Products returned successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.data).to.have.property(\"products\");", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + }, + "description": "Get all products." + }, + "response": [ + { + "name": "Products retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"products\": [\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"\",\n \"price\": \"\",\n \"stock\": \"\",\n \"category\": \"\"\n }\n ]\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Not Found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "invite", + "item": [ + { + "name": "create", + "item": [ + { + "name": "Create a new invitation link", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"organizationId\": \"\",\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/invite/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "invite", + "create" + ] + } + }, + "response": [ + { + "name": "Invitation link created and sent successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"organizationId\": \"\",\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/invite/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "invite", + "create" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"message\": \"\",\n \"data\": {\n \"invitationLink\": \"\"\n },\n \"status_code\": \"\"\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"organizationId\": \"\",\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/invite/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "invite", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"organizationId\": \"\",\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/invite/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "invite", + "create" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Internal server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"organizationId\": \"\",\n \"email\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/invite/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "invite", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "accept", + "item": [ + { + "name": "Accept an invitation", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/invite/accept?token=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "invite", + "accept" + ], + "query": [ + { + "key": "token", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Invitation accepted successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/invite/accept?token=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "invite", + "accept" + ], + "query": [ + { + "key": "token", + "value": "", + "description": "(Required) " + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"message\": \"\",\n \"status\": \"\"\n}" + }, + { + "name": "Invalid or expired invitation link", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/invite/accept?token=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "invite", + "accept" + ], + "query": [ + { + "key": "token", + "value": "", + "description": "(Required) " + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"message\": \"\",\n \"errors\": [\n \"\",\n \"\"\n ],\n \"status_code\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "api", + "item": [ + { + "name": "v1", + "item": [ + { + "name": "organisations", + "item": [ + { + "name": "send-invite", + "item": [ + { + "name": "Send invitations to join an organization", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"emails\": [\n \"\",\n \"\"\n ],\n \"org_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/organisations/send-invite", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "organisations", + "send-invite" + ] + } + }, + "response": [ + { + "name": "Invitations sent successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"emails\": [\n \"\",\n \"\"\n ],\n \"org_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/organisations/send-invite", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "organisations", + "send-invite" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": [\n {\n \"email\": \"\",\n \"expires_at\": \"\",\n \"organization\": \"\"\n },\n {\n \"email\": \"\",\n \"expires_at\": \"\",\n \"organization\": \"\"\n }\n ]\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"emails\": [\n \"\",\n \"\"\n ],\n \"org_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/organisations/send-invite", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "organisations", + "send-invite" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Forbidden", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"emails\": [\n \"\",\n \"\"\n ],\n \"org_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/organisations/send-invite", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "organisations", + "send-invite" + ] + } + }, + "status": "Forbidden", + "code": 403, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Internal server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"emails\": [\n \"\",\n \"\"\n ],\n \"org_id\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/organisations/send-invite", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "organisations", + "send-invite" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "invitations", + "item": [ + { + "name": "Retrieve invitations sent by admin", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/organisations/invitations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "organisations", + "invitations" + ] + } + }, + "response": [ + { + "name": "Request successful", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/organisations/invitations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "organisations", + "invitations" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": [\n {\n \"email\": \"\",\n \"org_id\": \"\",\n \"status\": \"\",\n \"sent_at\": \"\",\n \"expires_at\": \"\",\n \"invitation_token\": \"\"\n },\n {\n \"email\": \"\",\n \"org_id\": \"\",\n \"status\": \"\",\n \"sent_at\": \"\",\n \"expires_at\": \"\",\n \"invitation_token\": \"\"\n }\n ]\n}" + }, + { + "name": "Invalid request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/organisations/invitations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "organisations", + "invitations" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"error\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "New Request", + "request": { + "method": "GET", + "header": [] + }, + "response": [] + } + ] + }, + { + "name": "template", + "item": [ + { + "name": "{id}", + "item": [ + { + "name": "Retrieve a specific email template by its ID", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Template successfully retrieved", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"name\": \"\",\n \"body\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Template not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Update a specific email template by its ID", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"body\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Template successfully updated", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"body\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"name\": \"\",\n \"body\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"body\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Template not found", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"body\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation failed", + "originalRequest": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"body\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"error\": {\n \"TemplateRequest.Body\": \"\"\n }\n}" + } + ] + }, + { + "name": "Delete a specific email template by its ID", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Template successfully deleted", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Template not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Create a new email template", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"body\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/template", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template" + ] + } + }, + "response": [ + { + "name": "Template created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"body\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/template", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": {\n \"id\": \"\",\n \"name\": \"\",\n \"body\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"body\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/template", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation failed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"body\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/v1/template", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"error\": {\n \"TemplateRequest.Body\": \"\"\n }\n}" + } + ] + }, + { + "name": "Retrieve all email templates", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template" + ] + } + }, + "response": [ + { + "name": "Templates successfully retrieved", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\",\n \"data\": [\n {\n \"id\": \"\",\n \"name\": \"\",\n \"body\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\",\n \"body\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n ]\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/api/v1/template", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "v1", + "template" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "invite", + "item": [ + { + "name": "Accept an invitation", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"invitationLink\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/invite", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "invite" + ] + } + }, + "response": [ + { + "name": "Invitation accepted successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"invitationLink\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/invite", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "invite" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"message\": \"\",\n \"status\": \"\"\n}" + }, + { + "name": "Invalid or expired invitation link", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"invitationLink\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/invite", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "invite" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"message\": \"\",\n \"errors\": [\n \"\",\n \"\"\n ],\n \"status_code\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "notifications", + "item": [ + { + "name": "global", + "item": [ + { + "name": "Create a new notification", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random message", + "pm.environment.set(\"randomMessage\", `Message${Math.floor(Math.random() * 10000)}`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Notification created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + " pm.expect(jsonData.message).to.eql(\"Notification created successfully\");", + " ", + "", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"message\": \"{{randomMessage}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/notifications/global", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "global" + ] + } + }, + "response": [ + { + "name": "Notification created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"message\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/notifications/global", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "global" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {\n \"notifications\": [\n {\n \"notification_id\": \"\",\n \"userId\": \"\",\n \"message\": \"\",\n \"is_read\": \"\",\n \"created_at\": \"\"\n },\n {\n \"notification_id\": \"\",\n \"userId\": \"\",\n \"message\": \"\",\n \"is_read\": \"\",\n \"created_at\": \"\"\n }\n ]\n }\n}" + }, + { + "name": "Invalid request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"message\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/notifications/global", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "global" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"message\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/notifications/global", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "global" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "all", + "item": [ + { + "name": "Retrieve all notifications", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve notifications successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/all", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "all" + ] + } + }, + "response": [ + { + "name": "Notifications retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/all", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "all" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {\n \"total_notification_count\": \"\",\n \"total_unread_notification_count\": \"\",\n \"notifications\": [\n {\n \"notification_id\": \"\",\n \"is_read\": \"\",\n \"message\": \"\",\n \"created_at\": \"\"\n },\n {\n \"notification_id\": \"\",\n \"is_read\": \"\",\n \"message\": \"\",\n \"created_at\": \"\"\n }\n ]\n }\n}" + }, + { + "name": "Invalid request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/all", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "all" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/all", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "all" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "unread", + "item": [ + { + "name": "Retrieve unread notifications", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve unread notifications successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/unread?is_read=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "unread" + ], + "query": [ + { + "key": "is_read", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Unread notifications retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/unread?is_read=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "unread" + ], + "query": [ + { + "key": "is_read", + "value": "", + "description": "(Required) " + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {\n \"total_notification_count\": \"\",\n \"total_unread_notification_count\": \"\",\n \"notifications\": [\n {\n \"notification_id\": \"\",\n \"is_read\": \"\",\n \"message\": \"\",\n \"created_at\": \"\"\n },\n {\n \"notification_id\": \"\",\n \"is_read\": \"\",\n \"message\": \"\",\n \"created_at\": \"\"\n }\n ]\n }\n}" + }, + { + "name": "Invalid request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/unread?is_read=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "unread" + ], + "query": [ + { + "key": "is_read", + "value": "", + "description": "(Required) " + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/unread?is_read=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + "unread" + ], + "query": [ + { + "key": "is_read", + "value": "", + "description": "(Required) " + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "{notification_id}", + "item": [ + { + "name": "Mark a notification as read", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"is_read\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Notification updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"is_read\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {\n \"notification_id\": \"\",\n \"is_read\": \"\",\n \"updated_at\": \"\"\n }\n}" + }, + { + "name": "Invalid request", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"is_read\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized request", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"is_read\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Notification not found", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"is_read\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Delete a notification", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id", + "value": "", + "description": "(Required) " + } + ] + } + }, + "response": [ + { + "name": "Notification deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {}\n}" + }, + { + "name": "Invalid request", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized request", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Notification not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/notifications/:notification_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "notifications", + ":notification_id" + ], + "variable": [ + { + "key": "notification_id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "settings", + "item": [ + { + "name": "notification-settings", + "item": [ + { + "name": "Update notification settings", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"mobile_push_notifications\": \"\",\n \"email_notification_activity_in_workspace\": \"\",\n \"email_notification_always_send_email_notifications\": \"\",\n \"email_notification_email_digest\": \"\",\n \"email_notification_announcement_and_update_emails\": \"\",\n \"slack_notifications_activity_on_your_workspace\": \"\",\n \"slack_notifications_always_send_email_notifications\": \"\",\n \"slack_notifications_announcement_and_update_emails\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/settings/notification-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "settings", + "notification-settings" + ] + } + }, + "response": [ + { + "name": "Notification preferences updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"mobile_push_notifications\": \"\",\n \"email_notification_activity_in_workspace\": \"\",\n \"email_notification_always_send_email_notifications\": \"\",\n \"email_notification_email_digest\": \"\",\n \"email_notification_announcement_and_update_emails\": \"\",\n \"slack_notifications_activity_on_your_workspace\": \"\",\n \"slack_notifications_always_send_email_notifications\": \"\",\n \"slack_notifications_announcement_and_update_emails\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/settings/notification-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "settings", + "notification-settings" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {\n \"mobile_push_notifications\": \"\",\n \"email_notification_activity_in_workspace\": \"\",\n \"email_notification_always_send_email_notifications\": \"\",\n \"email_notification_email_digest\": \"\",\n \"email_notification_announcement_and_update_emails\": \"\",\n \"slack_notifications_activity_on_your_workspace\": \"\",\n \"slack_notifications_always_send_email_notifications\": \"\",\n \"slack_notifications_announcement_and_update_emails\": \"\"\n }\n}" + }, + { + "name": "Invalid input", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"mobile_push_notifications\": \"\",\n \"email_notification_activity_in_workspace\": \"\",\n \"email_notification_always_send_email_notifications\": \"\",\n \"email_notification_email_digest\": \"\",\n \"email_notification_announcement_and_update_emails\": \"\",\n \"slack_notifications_activity_on_your_workspace\": \"\",\n \"slack_notifications_always_send_email_notifications\": \"\",\n \"slack_notifications_announcement_and_update_emails\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/settings/notification-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "settings", + "notification-settings" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"mobile_push_notifications\": \"\",\n \"email_notification_activity_in_workspace\": \"\",\n \"email_notification_always_send_email_notifications\": \"\",\n \"email_notification_email_digest\": \"\",\n \"email_notification_announcement_and_update_emails\": \"\",\n \"slack_notifications_activity_on_your_workspace\": \"\",\n \"slack_notifications_always_send_email_notifications\": \"\",\n \"slack_notifications_announcement_and_update_emails\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/settings/notification-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "settings", + "notification-settings" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Retrieve notification settings", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve notification settings successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/settings/notification-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "settings", + "notification-settings" + ] + } + }, + "response": [ + { + "name": "Notification preferences retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/settings/notification-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "settings", + "notification-settings" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\",\n \"status_code\": \"\",\n \"data\": {\n \"mobile_push_notifications\": \"\",\n \"email_notification_activity_in_workspace\": \"\",\n \"email_notification_always_send_email_notifications\": \"\",\n \"email_notification_email_digest\": \"\",\n \"email_notification_announcement_and_update_emails\": \"\",\n \"slack_notifications_activity_on_your_workspace\": \"\",\n \"slack_notifications_always_send_email_notifications\": \"\",\n \"slack_notifications_announcement_and_update_emails\": \"\"\n }\n}" + }, + { + "name": "Invalid request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/settings/notification-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "settings", + "notification-settings" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unauthorized", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/settings/notification-settings", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "settings", + "notification-settings" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "help-center", + "item": [ + { + "name": "topics", + "item": [ + { + "name": "{id}", + "item": [ + { + "name": "Fetch a Help Center topic by ID", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id", + "value": "", + "description": "(Required) The ID of the Help Center topic to fetch" + } + ] + }, + "description": "Retrieves a Help Center topic by its ID." + }, + "response": [ + { + "name": "Topic retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"author\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n}" + }, + { + "name": "Authentication information is missing or invalid", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "The specified resource was not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Update a Help Center topic by ID", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id", + "value": "", + "description": "(Required) The ID of the Help Center topic to update" + } + ] + }, + "description": "Updates a Help Center topic by its ID." + }, + "response": [ + { + "name": "Topic updated successfully", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"author\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n}" + }, + { + "name": "Authentication information is missing or invalid", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "The specified resource was not found", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Failed to update topic", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Delete a Help Center topic by ID", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id", + "value": "", + "description": "(Required) The ID of the Help Center topic to delete" + } + ] + }, + "description": "Deletes a Help Center topic by its ID." + }, + "response": [ + { + "name": "Topic deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "No Content", + "code": 204, + "_postman_previewlanguage": "text", + "header": [], + "cookie": [], + "body": "" + }, + { + "name": "Authentication information is missing or invalid", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "The specified resource was not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Failed to delete topic", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "search", + "item": [ + { + "name": "Search Help Center topics", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/search?title=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + "search" + ], + "query": [ + { + "key": "title", + "value": "", + "description": "(Required) The search Topic title" + } + ] + }, + "description": "Searches Help Center topics by title and content." + }, + "response": [ + { + "name": "Search results retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/search?title=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + "search" + ], + "query": [ + { + "key": "title", + "value": "", + "description": "(Required) The search Topic title" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"author\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n },\n {\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"author\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n]" + }, + { + "name": "Authentication information is missing or invalid", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics/search?title=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics", + "search" + ], + "query": [ + { + "key": "title", + "value": "", + "description": "(Required) The search Topic title" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "Create a new Help Center topic", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random title", + "pm.environment.set(\"randomTitle\", `title${Math.floor(Math.random() * 10000)}`);", + "// Generate random content", + "pm.environment.set(\"randomContent\", `content${Math.floor(Math.random() * 10000)}`);", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Help Center topics created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + " pm.expect(jsonData.message).to.eql(\"Help Center topics created successfully\");", + " ", + "", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics" + ] + }, + "description": "Creates a new Help Center topic." + }, + "response": [ + { + "name": "Topic created successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"author\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n}" + }, + { + "name": "Invalid request body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication information is missing or invalid", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Validation failed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Failed to add topic", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"\",\n \"content\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/help-center/topics", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Fetch all Help Center topics", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve help center topics successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics?page=&limit=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics" + ], + "query": [ + { + "key": "page", + "value": "", + "description": "The page number for pagination" + }, + { + "key": "limit", + "value": "", + "description": "The number of items per page" + } + ] + }, + "description": "Retrieves all Help Center topics." + }, + "response": [ + { + "name": "Topics retrieved successfully", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics?page=&limit=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics" + ], + "query": [ + { + "key": "page", + "value": "", + "description": "The page number for pagination" + }, + { + "key": "limit", + "value": "", + "description": "The number of items per page" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"author\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n },\n {\n \"id\": \"\",\n \"title\": \"\",\n \"content\": \"\",\n \"author\": \"\",\n \"created_at\": \"\",\n \"updated_at\": \"\"\n }\n]" + }, + { + "name": "Authentication information is missing or invalid", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/help-center/topics?page=&limit=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "help-center", + "topics" + ], + "query": [ + { + "key": "page", + "value": "", + "description": "The page number for pagination" + }, + { + "key": "limit", + "value": "", + "description": "The number of items per page" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "contact", + "item": [ + { + "name": "{id}", + "item": [ + { + "name": "Delete a contact", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + ":id" + ], + "variable": [ + { + "key": "id", + "value": "", + "description": "(Required) ID of the contact to delete" + } + ] + }, + "description": "Deletes a contact by its ID." + }, + "response": [ + { + "name": "Contact deleted successfully", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Contact not found", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessable Entity", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + }, + { + "name": "id", + "item": [ + { + "name": "{id}", + "item": [ + { + "name": "Get a contact by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve contact by ID successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/id/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "id", + ":id" + ], + "variable": [ + { + "key": "id", + "value": "{{$randomUUID}}", + "description": "(Required) ID of the contact to retrieve" + } + ] + }, + "description": "Retrieves a specific contact by its ID." + }, + "response": [ + { + "name": "Contact details", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/id/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "id", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"name\": \"\",\n \"email\": \"\",\n \"subject\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/id/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "id", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/id/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "id", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Contact not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/id/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "id", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessable Entity", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/id/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "id", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/id/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "id", + ":id" + ], + "variable": [ + { + "key": "id" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "email", + "item": [ + { + "name": "{email}", + "item": [ + { + "name": "Get a contact by email", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve contact by email successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/email/:email", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "email", + ":email" + ], + "variable": [ + { + "key": "email", + "value": "{{email}}", + "description": "(Required) Email of the contact to retrieve" + } + ] + }, + "description": "Retrieves a contact by its email." + }, + "response": [ + { + "name": "Contact details", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/email/:email", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "email", + ":email" + ], + "variable": [ + { + "key": "email" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"\",\n \"name\": \"\",\n \"email\": \"\",\n \"subject\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/email/:email", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "email", + ":email" + ], + "variable": [ + { + "key": "email" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Authentication error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/email/:email", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "email", + ":email" + ], + "variable": [ + { + "key": "email" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Contact not found", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/email/:email", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "email", + ":email" + ], + "variable": [ + { + "key": "email" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessable Entity", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/email/:email", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "email", + ":email" + ], + "variable": [ + { + "key": "email" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact/email/:email", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact", + "email", + ":email" + ], + "variable": [ + { + "key": "email" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "Add a new message", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "// Generate random email", + "pm.environment.set(\"randomEmail\", `trendy${Math.floor(Math.random() * 100000)}@email.com`);", + "// Generate random name", + "pm.environment.set(\"randomName\", `Name${Math.floor(Math.random() * 10000)}`);", + "// Generate random subject", + "pm.environment.set(\"randomSubject\", `Subject${Math.floor(Math.random() * 10000)}`);", + "// Generate random message", + "pm.environment.set(\"randomMessage\", `Message${Math.floor(Math.random() * 10000)}`);" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 201 (Message created successfully)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(201);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"{{randomName}}\",\n \"email\": \"{{randomEmail}}\",\n \"subject\": \"{{randomSubject}}\",\n \"message\": \"{{randomMessage}}\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/contact", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ] + }, + "description": "Adds a new messages to the contact us list." + }, + "response": [ + { + "name": "Contact added successfully", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"email\": \"\",\n \"subject\": \"\",\n \"message\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/contact", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"email\": \"\",\n \"subject\": \"\",\n \"message\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/contact", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessable Entity", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"email\": \"\",\n \"subject\": \"\",\n \"message\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/contact", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"\",\n \"email\": \"\",\n \"subject\": \"\",\n \"message\": \"\"\n}", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/contact", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + }, + { + "name": "Get all messages", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Test if the status code is 200 (Retrieve messages successfully)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "// Test if the response time is less than 500ms", + "pm.test(\"Response time is less than 500ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(500);", + "});", + "", + "// Test if the response body contains the expected fields", + "pm.test(\"Response body contains expected fields\", function () {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData.status_code).to.eql(200);", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/contact?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + }, + "description": "Retrieves all contact entries." + }, + "response": [ + { + "name": "A list of contacts", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "[\n {\n \"id\": \"\",\n \"name\": \"\",\n \"email\": \"\",\n \"subject\": \"\",\n \"message\": \"\"\n },\n {\n \"id\": \"\",\n \"name\": \"\",\n \"email\": \"\",\n \"subject\": \"\",\n \"message\": \"\"\n }\n]" + }, + { + "name": "Bad Request", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"statuCode\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Unprocessable Entity", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Unprocessable Entity (WebDAV) (RFC 4918)", + "code": 422, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"errors\": [\n {\n \"field\": \"\"\n },\n {\n \"field\": \"\"\n }\n ],\n \"statuCode\": \"\",\n \"status\": \"\",\n \"message\": \"\"\n}" + }, + { + "name": "Server error", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer ", + "description": "Added as a part of security scheme: bearer" + } + ], + "url": { + "raw": "{{baseUrl}}/contact?page=1&limit=10", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "contact" + ], + "query": [ + { + "key": "page", + "value": "1", + "description": "Page number for pagination" + }, + { + "key": "limit", + "value": "10", + "description": "Number of items per page" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"status\": \"\",\n \"status_code\": \"\",\n \"message\": \"\"\n}" + } + ] + } + ] + } + ], + "variable": [ + { + "key": "baseUrl", + "value": "https://staging.api-golang.boilerplate.hng.tech/api/v1" + }, + { + "key": "bearerToken", + "value": "" + } + ] +} \ No newline at end of file