diff --git a/postman/Sandbox.postman_collection.json b/postman/Sandbox.postman_collection.json new file mode 100644 index 000000000..ed0e6e3f9 --- /dev/null +++ b/postman/Sandbox.postman_collection.json @@ -0,0 +1,3169 @@ +{ + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "var uuid = require('uuid');", + "", + "//assign the message batch reference", + "pm.variables.set(\"x_request_id\", uuid.v4());", + "", + "//assign the correlation id", + "pm.variables.set(\"correlation_id\", uuid.v4());" + ], + "packages": {}, + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "packages": {}, + "type": "text/javascript" + } + } + ], + "info": { + "_exporter_id": "47311855", + "_postman_id": "8199b1d7-24a1-46d6-8cdb-f90e50555e66", + "description": "Collection lets you execute a set of pre-generated requests to simulate responses from our sandbox environment. This environment is ready to use without any authentication or prior setup.\n\nFor further information please refer to", + "name": "NHS Notify Supplier API - Sandbox", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "item": [ + { + "item": [ + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", () => {", + " pm.response.to.have.status(200);", + "});", + "", + "const jsonData = pm.response.json();", + "pm.test(\"Response Body contains data field and status\", () => {", + " pm.expect(jsonData).to.have.property(\"data\");", + " pm.expect(jsonData.data.data.attributes).to.have.property(\"status\");", + " pm.expect(jsonData.data.data.attributes.status).to.equal('ACCEPTED'); // Check that status exists", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "200 Get Letter Status", + "request": { + "description": "Get details the status of a letter.", + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "Accept", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-Id", + "type": "text", + "value": "{{correlation_id}}" + }, + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "description": "(Required) Unique identifier of this resource", + "key": "id", + "value": "2AL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "response": [ + { + "_postman_previewlanguage": "json", + "body": "", + "code": 200, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "200 Get Letter Status - PENDING", + "originalRequest": { + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "status": "OK" + }, + { + "_postman_previewlanguage": "json", + "body": "", + "code": 200, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "200 Get Letter Status - PRINTED", + "originalRequest": { + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "2BL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "status": "OK" + }, + { + "_postman_previewlanguage": "json", + "body": "", + "code": 200, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "200 Get Letter Status - ENCLOSED", + "originalRequest": { + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "2CL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "status": "OK" + }, + { + "_postman_previewlanguage": "json", + "body": "", + "code": 200, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "200 Get Letter Status - DISPATCHED", + "originalRequest": { + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "2DL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "status": "OK" + }, + { + "_postman_previewlanguage": "json", + "body": "", + "code": 200, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "200 Get Letter Status - DELIVERED", + "originalRequest": { + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "2EL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "status": "OK" + }, + { + "_postman_previewlanguage": "json", + "body": "", + "code": 200, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "200 Get Letter Status - REJECTED", + "originalRequest": { + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "2WL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "status": "OK" + }, + { + "_postman_previewlanguage": "json", + "body": "", + "code": 200, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "200 Get Letter Status - CANCELLED", + "originalRequest": { + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "2XL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "status": "OK" + }, + { + "_postman_previewlanguage": "json", + "body": "", + "code": 200, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "200 Get Letter Status - FAILED", + "originalRequest": { + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "2YL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "status": "OK" + }, + { + "_postman_previewlanguage": "json", + "body": "", + "code": 200, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "200 Get Letter Status - RETURNED", + "originalRequest": { + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "2ZL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "status": "OK" + } + ] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404\", () => {", + " pm.response.to.have.status(404);", + "});", + "", + "const jsonData = pm.response.json();", + "pm.test(\"Response Body contains data field and status\", () => {", + " pm.expect(jsonData.data).to.have.property(\"errors\");", + " pm.expect(jsonData.data.errors[0].code).to.equal(\"NOTIFY_RESOURCE_NOT_FOUND\");", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "404 Not Found", + "request": { + "description": "Get details the status of a letter.", + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "Accept", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-Id", + "type": "text", + "value": "{{correlation_id}}" + }, + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "description": "(Required) Unique identifier of this resource", + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusP" + } + ] + } + }, + "response": [] + } + ], + "name": "Get Letter Status" + }, + { + "item": [ + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200);", + "});", + "", + "const jsonData = pm.response.json().data;", + "pm.test(\"Response Body contains data field\", () => {", + " pm.expect(jsonData.data).to.exist; // Check if attributes exist", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "200 - PatchLetters", + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "response": [ + { + "_postman_previewlanguage": null, + "body": null, + "cookie": [], + "header": null, + "name": "200 - PatchLetter-PENDING", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"status\": \"PENDING\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + } + }, + { + "_postman_previewlanguage": null, + "body": null, + "cookie": [], + "header": null, + "name": "200 - PatchLetters-CANCELLED", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "\n{\n \"data\": {\n \"attributes\": {\n \"reasonCode\": 100,\n \"reasonText\": \"failed validation\",\n \"status\": \"CANCELLED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + } + }, + { + "_postman_previewlanguage": null, + "body": null, + "cookie": [], + "header": null, + "name": "200 - PatchLetter-ACCEPTED", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"status\": \"ACCEPTED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + } + }, + { + "_postman_previewlanguage": null, + "body": null, + "cookie": [], + "header": null, + "name": "200 - PatchLetter-DELIVERED", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"status\": \"DELIVERED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}\n" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + } + }, + { + "_postman_previewlanguage": null, + "body": null, + "cookie": [], + "header": null, + "name": "200 - PatchLetter-DISPATCHED", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"status\": \"DISPATCHED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + } + }, + { + "_postman_previewlanguage": null, + "body": null, + "cookie": [], + "header": null, + "name": "200 - PatchLetter-ENCLOSED", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"status\": \"ENCLOSED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + } + }, + { + "_postman_previewlanguage": null, + "body": null, + "cookie": [], + "header": null, + "name": "200 - PatchLetter-FAILED", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"reasonCode\": 100,\n \"reasonText\": \"failed validation\",\n \"status\": \"FAILED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + } + }, + { + "_postman_previewlanguage": null, + "body": null, + "cookie": [], + "header": null, + "name": "200 - PatchLetter-PRINTED", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"status\": \"PRINTED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + } + } + ] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400);", + "});" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "400 - Invalid Request", + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"status\": \"INVALID_STATUS\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "{{id}}" + } + ] + } + }, + "response": [] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404\", () => {", + " pm.response.to.have.status(404);", + "});" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "404 - Not Found", + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"status\": \"ACCEPTED\"\n },\n \"id\": \"123654789\",\n \"type\": \"Letter\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "PATCH", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id" + ], + "raw": "{{baseUrl}}/letters/:id", + "variable": [ + { + "key": "id", + "value": "" + } + ] + } + }, + "response": [] + } + ], + "name": "Update Letter Status" + }, + { + "item": [ + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200);", + "});", + "", + "const jsonData = pm.response.json();", + "pm.test(\"Response Body contains data field and its size is correct\", () => {", + " const jsonData = pm.response.json();", + " pm.expect(jsonData).to.have.property(\"data\");", + " pm.expect(jsonData.data.data).to.be.an('array').and.have.length.greaterThanOrEqual(10);", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "200 - Get List Of PENDING Letters", + "request": { + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters" + ], + "query": [ + { + "key": "limit", + "value": "10" + } + ], + "raw": "{{baseUrl}}/letters?limit=10" + } + }, + "response": [] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400);", + "});", + "", + "const jsonData = pm.response.json();", + "pm.test(\"Response Body contains error message\", () => {", + " pm.expect(jsonData).to.have.property(\"message\");", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "400 - GetLetters InCorrectQueryParam", + "request": { + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters" + ], + "query": [ + { + "key": "limit", + "value": "XX" + } + ], + "raw": "{{baseUrl}}/letters?limit=XX" + } + }, + "response": [] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is Bad Request\", () => {", + " pm.response.to.have.status(400);", + "});" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "400 - GetLetters_X-request-id", + "request": { + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters" + ], + "query": [ + { + "key": "limit", + "value": "1" + } + ], + "raw": "{{baseUrl}}/letters?limit=1" + } + }, + "response": [] + } + ], + "name": "Get List Of PENDING Letters" + }, + { + "item": [ + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200);", + "});" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "200 - UpdateStatusMultiLetters", + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": [\n {\n \"attributes\": {\n \"status\": \"PENDING\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n },\n {\n \"attributes\": {\n \"status\": \"ACCEPTED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n },\n {\n \"attributes\": {\n \"status\": \"PRINTED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n },\n {\n \"attributes\": {\n \"status\": \"ENCLOSED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n },\n {\n \"attributes\": {\n \"status\": \"DISPATCHED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n },\n {\n \"attributes\": {\n \"status\": \"DELIVERED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n },\n {\n \"attributes\": {\n \"reasonCode\": 100,\n \"reasonText\": \"failed validation\",\n \"status\": \"RETURNED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n },\n {\n \"attributes\": {\n \"reasonCode\": 100,\n \"reasonText\": \"failed validation\",\n \"status\": \"CANCELLED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n },\n {\n \"attributes\": {\n \"reasonCode\": 100,\n \"reasonText\": \"failed validation\",\n \"status\": \"FAILED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n },\n {\n \"attributes\": {\n \"reasonCode\": 100,\n \"reasonText\": \"failed validation\",\n \"status\": \"RETURNED\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"Letter\"\n }\n ]\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters" + ], + "raw": "{{baseUrl}}/letters" + } + }, + "response": [] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200);", + "});" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "404 - Not Found", + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "language": "json" + } + }, + "raw": "{\n \"data\": [\n {\n \"attributes\": {\n \"status\": \"PENDING\"\n },\n \"id\": \"123654789\",\n \"type\": \"Letter\"\n }\n ]\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters" + ], + "raw": "{{baseUrl}}/letters" + } + }, + "response": [] + } + ], + "name": "Update Multiple Letter Status" + } + ], + "name": "Letters" + }, + { + "item": [ + { + "item": [ + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 303\", () => {", + " pm.response.to.have.status(303);", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "303 Fetch Data File", + "request": { + "header": [ + { + "key": "Accept", + "type": "default", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-Id", + "type": "default", + "value": "{{correlation_id}}" + }, + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id", + "data" + ], + "query": [ + { + "disabled": true, + "key": "", + "value": null + } + ], + "raw": "{{baseUrl}}/letters/:id/data", + "variable": [ + { + "key": "id", + "value": "2AL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "response": [ + { + "_postman_previewlanguage": "Text", + "body": "", + "cookie": [], + "header": [], + "name": "300 Fetch Data File", + "originalRequest": { + "header": [], + "method": "GET", + "url": { + "raw": "" + } + } + } + ] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404\", () => {", + " pm.response.to.have.status(404);", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "404 Not Found", + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "accept": true + } + }, + "request": { + "header": [ + { + "key": "Accept", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-Id", + "type": "text", + "value": "{{correlation_id}}" + }, + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id", + "data" + ], + "raw": "{{baseUrl}}/letters/:id/data", + "variable": [ + { + "key": "id", + "value": "2AL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "response": [] + } + ], + "name": "Fetch Data File" + }, + { + "item": [ + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", () => {", + " pm.response.to.have.status(200);", + "});", + "", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "200 Data File Exists", + "request": { + "header": [ + { + "key": "Accept", + "type": "default", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-Id", + "type": "default", + "value": "{{correlation_id}}" + }, + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + } + ], + "method": "HEAD", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters", + ":id", + "data" + ], + "query": [ + { + "disabled": true, + "key": "", + "value": null + } + ], + "raw": "{{baseUrl}}/letters/:id/data", + "variable": [ + { + "key": "id", + "value": "2AL5eYSWGzCHlGmzNxuqVusPxDg" + } + ] + } + }, + "response": [ + { + "_postman_previewlanguage": "Text", + "body": "", + "cookie": [], + "header": [], + "name": "200 File exists", + "originalRequest": { + "header": [], + "method": "GET", + "url": { + "raw": "" + } + } + } + ] + } + ], + "name": "Check Data File" + } + ], + "name": "Data" + }, + { + "item": [ + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", () => {", + " pm.response.to.have.status(201);", + "});", + "", + "", + "const jsonData = pm.response.json();", + "pm.test(\"Response Body contains data field and status\", () => {", + " pm.expect(jsonData).to.have.property(\"data\");", + " pm.expect(jsonData.data).to.have.property(\"id\");", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "201 - Create New record", + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"lineItem\": \"envelope-business-standard\",\n \"quantity\": 22,\n \"specificationId\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "value": "{{x_request_id}}" + }, + { + "key": "X-Correlation-ID", + "value": "{{correlation_id}}" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "response": [ + { + "_postman_previewlanguage": "json", + "body": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"ManagementInformation\"\n }\n}", + "code": 201, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Management Information created successfully", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Created" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_RESOURCE_NOT_FOUND\",\n \"detail\": \"No resource found with that ID\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"404\",\n \"title\": \"Resource not found\"\n }\n ]\n}", + "code": 404, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Resource not found", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Not Found" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_QUOTA\",\n \"detail\": \"You have made too many requests. Please try again later.\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"429\",\n \"title\": \"Too many requests\"\n }\n ]\n}", + "code": 429, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Too many requests", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Too Many Requests" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_INTERNAL_SERVER_ERROR\",\n \"detail\": \"An unexpected error occurred, please contact support\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"500\",\n \"title\": \"Internal Server Error\"\n }\n ]\n}", + "code": 500, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Server error", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Internal Server Error" + } + ] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", () => {", + " pm.response.to.have.status(201);", + "});", + "", + "", + "const jsonData = pm.response.json();", + "pm.test(\"Response Body contains data field and status\", () => {", + " pm.expect(jsonData).to.have.property(\"data\");", + " pm.expect(jsonData.data).to.have.property(\"id\");", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "201 - INVALID", + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"groupId\": \"abc123\",\n \"lineItem\": \"envelope-business-standard\",\n \"quantity\": 22,\n \"specificationId\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"yesterday\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "key": "X-Request-ID", + "value": "{{x_request_id}}" + }, + { + "key": "X-Correlation-ID", + "value": "{{correlation_id}}" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "response": [ + { + "_postman_previewlanguage": "json", + "body": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"ManagementInformation\"\n }\n}", + "code": 201, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Management Information created successfully", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Created" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_RESOURCE_NOT_FOUND\",\n \"detail\": \"No resource found with that ID\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"404\",\n \"title\": \"Resource not found\"\n }\n ]\n}", + "code": 404, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Resource not found", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Not Found" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_QUOTA\",\n \"detail\": \"You have made too many requests. Please try again later.\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"429\",\n \"title\": \"Too many requests\"\n }\n ]\n}", + "code": 429, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Too many requests", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Too Many Requests" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_INTERNAL_SERVER_ERROR\",\n \"detail\": \"An unexpected error occurred, please contact support\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"500\",\n \"title\": \"Internal Server Error\"\n }\n ]\n}", + "code": 500, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Server error", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Internal Server Error" + } + ] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404\", () => {", + " pm.response.to.have.status(404);", + "});", + "", + "", + "const jsonData = pm.response.json();", + "pm.test(\"Response Body contains data field and status\", () => {", + " pm.expect(jsonData).to.have.property(\"errors\");", + " pm.expect(jsonData.errors[0].status).to.be(404);", + "});", + "" + ], + "packages": {}, + "requests": {}, + "type": "text/javascript" + } + } + ], + "name": "404 - Not Found", + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"envelope-business-standard\",\n \"quantity\": 22,\n \"specificationId\": \"123456\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n }\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "response": [ + { + "_postman_previewlanguage": "json", + "body": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"ManagementInformation\"\n }\n}", + "code": 201, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Management Information created successfully", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Created" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_RESOURCE_NOT_FOUND\",\n \"detail\": \"No resource found with that ID\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"404\",\n \"title\": \"Resource not found\"\n }\n ]\n}", + "code": 404, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Resource not found", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Not Found" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_QUOTA\",\n \"detail\": \"You have made too many requests. Please try again later.\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"429\",\n \"title\": \"Too many requests\"\n }\n ]\n}", + "code": 429, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Too many requests", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Too Many Requests" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_INTERNAL_SERVER_ERROR\",\n \"detail\": \"An unexpected error occurred, please contact support\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"500\",\n \"title\": \"Internal Server Error\"\n }\n ]\n}", + "code": 500, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Server error", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Internal Server Error" + } + ] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 429\", () => {", + " pm.response.to.have.status(429);", + "});" + ], + "packages": {}, + "type": "text/javascript" + } + } + ], + "name": "429 - Too Many Requests", + "request": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + }, + { + "key": "Prefer", + "type": "text", + "value": "code=429" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "response": [ + { + "_postman_previewlanguage": "json", + "body": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"id\": \"2WL5eYSWGzCHlGmzNxuqVusPxDg\",\n \"type\": \"ManagementInformation\"\n }\n}", + "code": 201, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Management Information created successfully", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Created" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_RESOURCE_NOT_FOUND\",\n \"detail\": \"No resource found with that ID\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"404\",\n \"title\": \"Resource not found\"\n }\n ]\n}", + "code": 404, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Resource not found", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Not Found" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_QUOTA\",\n \"detail\": \"You have made too many requests. Please try again later.\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"429\",\n \"title\": \"Too many requests\"\n }\n ]\n}", + "code": 429, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Too many requests", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Too Many Requests" + }, + { + "_postman_previewlanguage": "json", + "body": "{\n \"errors\": [\n {\n \"code\": \"NOTIFY_INTERNAL_SERVER_ERROR\",\n \"detail\": \"An unexpected error occurred, please contact support\",\n \"id\": \"rrt-1931948104716186917-c-geu2-10664-3111479-3.0\",\n \"links\": {\n \"about\": \"https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier\"\n },\n \"status\": \"500\",\n \"title\": \"Internal Server Error\"\n }\n ]\n}", + "code": 500, + "cookie": [], + "header": [ + { + "key": "Content-Type", + "value": "application/vnd.api+json" + } + ], + "name": "Server error", + "originalRequest": { + "body": { + "mode": "raw", + "options": { + "raw": { + "headerFamily": "json", + "language": "json" + } + }, + "raw": "{\n \"data\": {\n \"attributes\": {\n \"cost\": 10.25,\n \"groupId\": \"abc123\",\n \"lineItem\": \"Letter\",\n \"quantity\": 22,\n \"specificationId\": \"da0b1495-c7cb-468c-9d81-07dee089d728\",\n \"stockRemaining\": 2000,\n \"timestamp\": \"2023-11-17T14:27:51.413Z\"\n },\n \"type\": \"ManagementInformation\"\n }\n}" + }, + "header": [ + { + "description": "(Required) Unique request identifier, in the format of a GUID", + "key": "X-Request-ID", + "value": "dcb9c8dc-c2f4-4d5f-8674-a2e913e040b2" + }, + { + "description": "An optional ID which you can use to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters. If not provided in the request, NHS Notify will default to a system generated ID in its place.\nThe ID will be returned in a response header.", + "key": "X-Correlation-ID", + "value": "11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA" + }, + { + "key": "Content-Type", + "value": "application/vnd.api+json" + }, + { + "key": "Accept", + "value": "application/vnd.api+json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "mi" + ], + "raw": "{{baseUrl}}/mi" + } + }, + "status": "Internal Server Error" + } + ] + } + ], + "name": "MI" + }, + { + "item": [ + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Correlation identifier is returned\", () => {", + " pm.response.to.have.header(\"x-correlation-id\");", + " pm.response.to.be.header(\"x-correlation-id\", pm.variables.get(\"correlation_id\"));", + "});", + "", + "pm.test(\"Status code is 429\", () => {", + " pm.response.to.have.status(429);", + "});", + "" + ], + "packages": {}, + "type": "text/javascript" + } + } + ], + "name": "429 - Too Many Requests", + "request": { + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + }, + { + "key": "Prefer", + "type": "text", + "value": "code=429" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters" + ], + "raw": "{{baseUrl}}/letters" + } + }, + "response": [] + }, + { + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Correlation identifier is returned\", () => {", + " pm.response.to.have.header(\"x-correlation-id\");", + " pm.response.to.be.header(\"x-correlation-id\", pm.variables.get(\"correlation_id\"));", + "});", + "", + "pm.test(\"Status code is 408\", () => {", + " pm.response.to.have.status(408);", + "});", + "" + ], + "packages": {}, + "type": "text/javascript" + } + } + ], + "name": "408 - Request Time Out", + "request": { + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + }, + { + "key": "Prefer", + "type": "text", + "value": "code=408" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters" + ], + "raw": "{{baseUrl}}/letters" + } + }, + "response": [] + }, + { + "name": "500 - Server Error", + "request": { + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + }, + { + "key": "Prefer", + "type": "text", + "value": "code=429" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters" + ], + "raw": "{{baseUrl}}/letters" + } + }, + "response": [] + }, + { + "name": "401 - Unauthorized", + "request": { + "header": [ + { + "key": "X-Request-ID", + "type": "text", + "value": "{{x_request_id}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/vnd.api+json" + }, + { + "key": "X-Correlation-ID", + "type": "text", + "value": "{{correlation_id}}" + }, + { + "key": "Prefer", + "type": "text", + "value": "code=401" + } + ], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "letters" + ], + "raw": "{{baseUrl}}/letters" + } + }, + "response": [] + } + ], + "name": "Errors" + } + ], + "variable": [ + { + "key": "baseUrl", + "value": "https://internal-dev-sandbox.api.service.nhs.uk/nhs-notify-supplier-PR-164" + }, + { + "key": "id", + "value": "24L5eYSWGzCHlGmzNxuqVusPxDg" + } + ] +}