I get this image
And the text:
{
"collection": {
"info": {
"_postman_id": "bf5e034b-1d9f-4a3d-82f0-9e48791b2b6c",
"name": "Day 03: Add request details",
"description": "**Deleted it so it's readable**",
"schema": "https:// schema. getpostman. com/json/collection/v2.1.0/collection.json",
"fork": {
"label": "Anne's fork",
"createdAt": "2021-04-07T19:19:40.000Z",
"from": "1559645-969f4824-25ba-4ed6-8926-f71ce4ee079d"
},
"updatedAt": "2023-12-07T14:13:29.000Z",
"uid": "31658839-bf5e034b-1d9f-4a3d-82f0-9e48791b2b6c"
},
"item": [
{
"name": "Add request details",
"item": [
{
"name": "New Request",
"id": "d26a7a70-ef41-4d61-8566-465f49caa6d5",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "{{baseURL}}/post",
"host": [
"{{baseURL}}"
],
"path": [
"post"
]
}
},
"response": [],
"uid": "31658839-d26a7a70-ef41-4d61-8566-465f49caa6d5"
}
],
"id": "0144fc58-2b8b-4d88-8a80-5486e3bb4887",
"description": "**Deleted it so it's readable**",
"uid": "31658839-0144fc58-2b8b-4d88-8a80-5486e3bb4887"
},
{
"name": "Submit your solution",
"item": [
{
"name": "submit",
"event": [
{
"listen": "test",
"script": {
"id": "06bd2391-e094-41a3-83de-35b4cb3ed622",
"exec": [
"// counter for passed tests\r",
"let pass = 0\r",
"let totalToPass = 5\r",
"\r",
"let collection = pm.response.json().collection\r",
"\r",
"pm.test(\"If you have any failures, review the failed test results or ask for support in the community forum. Remember to save your changes if you update the collection. When all of your tests pass, you are done with today's challenge.\", () => {\r",
" pm.expect(true);\r",
" pass += 1\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", () => {\r",
" pm.response.to.have.status(200);\r",
" pass += 1\r",
"});\r",
"\r",
"pm.test(\"Correct collection returned\", () => {\r",
" pm.expect(collection.info.name).equals(\"Day 03: Add request details\")\r",
" pass += 1\r",
"})\r",
"\r",
"let folder = collection.item.find(fol => { return fol.name == \"Add request details\"})\r",
"\r",
"pm.test(\"Request added correctly\", () => {\r",
" pm.expect(folder.item.length, 'check number of requests').is.greaterThan(0)\r",
"\r",
" let newRequest = folder.item.find(req => { return req.name === \"raw JSON body\"})\r",
"\r",
" pm.expect(newRequest.name, 'check name').equals(\"raw JSON body\")\r",
" pm.expect(newRequest.request.method, 'check method').equals(\"POST\")\r",
" pass += 1\r",
"})\r",
"\r",
"pm.test(\"JSON body correct\", () => {\r",
" let newRequest = collection.item[0].item.find(req => { return req.name === \"raw JSON body\"})\r",
"\r",
" pm.expect(newRequest.request.body.mode, 'check mode').equals(\"raw\")\r",
" pm.expect(newRequest.request.body.options.raw.language, 'check language').equals(\"json\")\r",
" pm.expect(newRequest.request.body.raw, 'check json').to.not.be.empty\r",
" // TODO: add json schema validation\r",
" pass += 1\r",
"})\r",
"\r",
"// visualization for test results\r",
"let template\r",
"if (pass == totalToPass) {\r",
" template = `🍪 passing!\r",
" <br />\r",
" \r",
" `\r",
"} else {\r",
" template = `🙅 please try again\r",
" <br />\r",
" \r",
" `\r",
"}\r",
"pm.visualizer.set(template)"
],
"type": "text/javascript"
}
}
],
"id": "96d1278f-0331-4997-bb2d-c3c0508f7cda",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "PMAK-6571cc7a9466cf200b9253c0-19658fd68c9e3b796d040d11138XXXXX",
"type": "string"
},
{
"key": "key",
"value": "X-API-Key",
"type": "string"
},
{
"key": "in",
"value": "header",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https:// api. getpostman. com/collections/31658839-bf5e034b-1d9f-4a3d-82f0-9e48791b2b6c",
"protocol": "https",
"host": [
"api",
"getpostman",
"com"
],
"path": [
"collections",
"31658839-bf5e034b-1d9f-4a3d-82f0-9e48791b2b6c"
]
},
"description": "**Deleted it so it's readable**"
},
"response": [],
"uid": "31658839-96d1278f-0331-4997-bb2d-c3c0508f7cda"
}
],
"id": "87e52d32-cf2d-4029-bf05-05bcc53f2f45",
"description": "Follow the instructions in the request documentation.",
"uid": "31658839-87e52d32-cf2d-4029-bf05-05bcc53f2f45"
}
],
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{value}}",
"type": "string"
},
{
"key": "key",
"value": "{{key}}",
"type": "string"
},
{
"key": "in",
"value": "header",
"type": "string"
}
]
},
"variable": [
{
"key": "value",
"value": "",
"type": "default"
},
{
"key": "key",
"value": "",
"type": "default"
},
{
"key": "in",
"value": "",
"type": "default"
}
]
}
}
I checked the API key and the ID (copied it from the collection details) and those should be the right ones