Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save christian-bromann/8a53f02af87da8cca635278aa5f6c176 to your computer and use it in GitHub Desktop.
Save christian-bromann/8a53f02af87da8cca635278aa5f6c176 to your computer and use it in GitHub Desktop.
{
"info": {
"_postman_id": "7a8337f5-12f0-4b28-8462-2809cece17e5",
"name": "Contact List Documentation",
"description": "This is the API for the Contact List App: \nhttps://thinking-tester-contact-list.herokuapp.com/",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "33129"
},
"item": [
{
"name": "Contacts",
"item": [
{
"name": "Add Contact",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"birthdate\": \"1970-01-01\",\n \"email\": \"[email protected]\",\n \"phone\": \"8005555555\",\n \"street1\": \"1 Main St.\",\n \"street2\": \"Apartment A\",\n \"city\": \"Anytown\",\n \"stateProvince\": \"KS\",\n \"postalCode\": \"12345\",\n \"country\": \"USA\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts"
]
}
},
"response": [
{
"name": "Add Contact",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"birthdate\": \"1970-01-01\",\n \"email\": \"[email protected]\",\n \"phone\": \"8005555555\",\n \"street1\": \"1 Main St.\",\n \"street2\": \"Apartment A\",\n \"city\": \"Anytown\",\n \"stateProvince\": \"KS\",\n \"postalCode\": \"12345\",\n \"country\": \"USA\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts"
]
}
},
"status": "Created",
"code": 201,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "{\n \"_id\": \"6085a221fcfc72405667c3d4\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"birthdate\": \"1970-01-01\",\n \"email\": \"[email protected]\",\n \"phone\": \"8005555555\",\n \"street1\": \"1 Main St.\",\n \"street2\": \"Apartment A\",\n \"city\": \"Anytown\",\n \"stateProvince\": \"KS\",\n \"postalCode\": \"12345\",\n \"country\": \"USA\",\n \"owner\": \"6085a21efcfc72405667c3d4\",\n \"__v\": 0\n}"
}
]
},
{
"name": "Get Contact List",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts"
]
}
},
"response": [
{
"name": "Get Contact List",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "[\n {\n \"_id\": \"6085a221fcfc72405667c3d4\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"birthdate\": \"1970-01-01\",\n \"email\": \"[email protected]\",\n \"phone\": \"8005555555\",\n \"street1\": \"1 Main St.\",\n \"street2\": \"Apartment A\",\n \"city\": \"Anytown\",\n \"stateProvince\": \"KS\",\n \"postalCode\": \"12345\",\n \"country\": \"USA\",\n \"owner\": \"6085a21efcfc72405667c3d4\",\n \"__v\": 0\n },\n {\n \"_id\": \"607b29861ba4d3a0b96733bc\",\n \"firstName\": \"Jan\",\n \"lastName\": \"Brady\",\n \"birthdate\": \"2001-11-11\",\n \"email\": \"[email protected]\",\n \"phone\": \"8008675309\",\n \"street1\": \"100 Elm St.\",\n \"city\": \"Springfield\",\n \"stateProvince\": \"NE\",\n \"postalCode\": \"23456\",\n \"country\": \"United States\",\n \"owner\": \"6085a21efcfc72405667c3d4\",\n \"__v\": 0\n }\n]"
}
]
},
{
"name": "Get Contact",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts/{{contactId}}",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts",
"{{contactId}}"
]
}
},
"response": [
{
"name": "Get Contact",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts/{{contactId}}",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts",
"{{contactId}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "{\n \"_id\": \"6085a221fcfc72405667c3d4\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"birthdate\": \"1970-01-01\",\n \"email\": \"[email protected]\",\n \"phone\": \"8005555555\",\n \"street1\": \"1 Main St.\",\n \"street2\": \"Apartment A\",\n \"city\": \"Anytown\",\n \"stateProvince\": \"KS\",\n \"postalCode\": \"12345\",\n \"country\": \"USA\",\n \"owner\": \"6085a21efcfc72405667c3d4\",\n \"__v\": 0\n}"
}
]
},
{
"name": "Update Contact",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Amy\",\n \"lastName\": \"Miller\",\n \"birthdate\": \"1992-02-02\",\n \"email\": \"[email protected]\",\n \"phone\": \"8005554242\",\n \"street1\": \"13 School St.\",\n \"street2\": \"Apt. 5\",\n \"city\": \"Washington\",\n \"stateProvince\": \"QC\",\n \"postalCode\": \"A1A1A1\",\n \"country\": \"Canada\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts/{{contactId}}",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts",
"{{contactId}}"
]
}
},
"response": [
{
"name": "Update Contact",
"originalRequest": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Amy\",\n \"lastName\": \"Miller\",\n \"birthdate\": \"1992-02-02\",\n \"email\": \"[email protected]\",\n \"phone\": \"8005554242\",\n \"street1\": \"13 School St.\",\n \"street2\": \"Apt. 5\",\n \"city\": \"Washington\",\n \"stateProvince\": \"QC\",\n \"postalCode\": \"A1B2D4\",\n \"country\": \"Canada\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts/{{contactId}}",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts",
"{{contactId}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "{\n \"_id\": \"6085a221fcfc72405667c3d4\",\n \"firstName\": \"Amy\",\n \"lastName\": \"Miller\",\n \"birthdate\": \"1992-02-02\",\n \"email\": \"[email protected]\",\n \"phone\": \"8005554242\",\n \"street1\": \"13 School St.\",\n \"street2\": \"Apt. 5\",\n \"city\": \"Washington\",\n \"stateProvince\": \"QC\",\n \"postalCode\": \"A1A1A1\",\n \"country\": \"Canada\"\n \"owner\": \"6085a21efcfc72405667c3d4\",\n \"__v\": 0\n}"
}
]
},
{
"name": "Update Contact",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Anna\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts/{{contactId}}",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts",
"{{contactId}}"
]
},
"description": "The PATCH Update Contact operation is not available through the UI."
},
"response": [
{
"name": "Update Contact",
"originalRequest": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Anna\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts/{{contactId}}",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts",
"{{contactId}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "{\n \"_id\": \"6085a221fcfc72405667c3d4\",\n \"firstName\": \"Anna\",\n \"lastName\": \"Miller\",\n \"birthdate\": \"1992-02-02\",\n \"email\": \"[email protected]\",\n \"phone\": \"8005554242\",\n \"street1\": \"13 School St.\",\n \"street2\": \"Apt. 5\",\n \"city\": \"Washington\",\n \"stateProvince\": \"QC\",\n \"postalCode\": \"A1B2D4\",\n \"country\": \"Canada\"\n \"owner\": \"6085a21efcfc72405667c3d4\",\n \"__v\": 0\n}"
}
]
},
{
"name": "Delete Contact",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"pm.test(\"Deletion success message received\", function () {",
" pm.response.to.have.body(\"Contact deleted\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts/{{contactId}}",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts",
"{{contactId}}"
]
}
},
"response": [
{
"name": "Delete Contact",
"originalRequest": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/contacts/{{contactId}}",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"contacts",
"{{contactId}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "Contact deleted"
}
]
}
]
},
{
"name": "Users",
"item": [
{
"name": "Add User",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Test\",\n \"lastName\": \"User\",\n \"email\": \"[email protected]\",\n \"password\": \"myPassword\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users"
]
}
},
"response": [
{
"name": "Add User",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Test\",\n \"lastName\": \"User\",\n \"email\": \"[email protected]\",\n \"password\": \"myPassword\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users"
]
}
},
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "{\n \"user\": {\n \"_id\": \"608b2db1add2691791c04c89\",\n \"firstName\": \"Test\",\n \"lastName\": \"User\",\n \"email\": \"[email protected]\",\n \"__v\": 1\n },\n \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MDhiMmRiMWFkZDI2OTE3OTFjMDRjODgiLCJpYXQiOjE2MTk3MzM5Mzd9.06wN8dRBLkFiS_m2XdY6h4oLx3nMeupHvv-3C2AEKlY\"\n}"
}
]
},
{
"name": "Get User Profile",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/me",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"me"
]
},
"description": "The GET User Profile operation is not available through the UI."
},
"response": [
{
"name": "Get User Profile",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/me",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"me"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "{\n \"_id\": \"608b2db1add2691791c04c89\",\n \"firstName\": \"Test\",\n \"lastName\": \"User\",\n \"email\": \"[email protected]\",\n \"__v\": 1\n}"
}
]
},
{
"name": "Update User",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Updated\",\n \"lastName\": \"Username\",\n \"email\": \"[email protected]\",\n \"password\": \"myNewPassword\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/me",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"me"
]
},
"description": "The PATCH Update User operation is not available through the UI."
},
"response": [
{
"name": "Update User",
"originalRequest": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Updated\",\n \"lastName\": \"Username\",\n \"email\": \"[email protected]\",\n \"password\": \"myNewPassword\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/me",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"me"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "{\n \"_id\": \"608b2db1add2691791c04c89\",\n \"firstName\": \"Updated\",\n \"lastName\": \"Username\",\n \"email\": \"[email protected]\",\n \"__v\": 1\n}"
}
]
},
{
"name": "Log Out User",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/logout",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"logout"
]
}
},
"response": [
{
"name": "Log Out User",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/logout",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"logout"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": null
}
]
},
{
"name": "Log In User",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"[email protected]\",\n \"password\": \"myNewPassword\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/login",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"login"
]
}
},
"response": [
{
"name": "Log In User",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"[email protected]\",\n \"password\": \"myNewPassword\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/login",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"login"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": "{\n \"user\": {\n \"_id\": \"608b2db1add2691791c04c89\",\n \"firstName\": \"Updated\",\n \"lastName\": \"Username\",\n \"email\": \"[email protected]\",\n \"__v\": 212\n },\n \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MDgyMWYzMDYyZmJiMjEzZTJhZDlhMjAiLCJpYXQiOjE2MTk3MzQ0NDB9.4CftGzYRmK04PJv6xKqmWWo9iOH2wlizEU8vk-L48LI\"\n}"
}
]
},
{
"name": "Delete User",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/me",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"me"
]
},
"description": "The DELETE User operation is not available through the UI."
},
"response": [
{
"name": "Delete User",
"originalRequest": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://thinking-tester-contact-list.herokuapp.com/users/me",
"protocol": "https",
"host": [
"thinking-tester-contact-list",
"herokuapp",
"com"
],
"path": [
"users",
"me"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "Text",
"header": null,
"cookie": [],
"body": null
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment