You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Book-RestAPI/GRACE.postman_collection.json

312 lines
5.8 KiB
JSON

{
"info": {
"_postman_id": "0db7cb04-aafc-4e5f-8ff8-218495e6ecca",
"name": "# GRACE",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "1829038"
},
"item": [
{
"name": "Book",
"item": [
{
"name": "Get LIst Book",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "localhost:3000/books?genre=&author=&start=2023-01-01&end=2023-12-12",
"host": [
"localhost"
],
"port": "3000",
"path": [
"books"
],
"query": [
{
"key": "genre",
"value": ""
},
{
"key": "author",
"value": ""
},
{
"key": "start",
"value": "2023-01-01"
},
{
"key": "end",
"value": "2023-12-12"
}
]
}
},
"response": []
},
{
"name": "Create Book",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"author\": \"John Doe\",\n \"description\": \"This is a test book\",\n \"edition\": \"First Edition\",\n \"genre\": \"Fiction\",\n \"published_at\": \"2023-01-01T00:00:00Z\",\n \"title\": \"Test Book\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:3000/books",
"host": [
"localhost"
],
"port": "3000",
"path": [
"books"
]
}
},
"response": []
},
{
"name": "Update Book",
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"{{$randomJobTitle}}\",\n \"author\": \"{{$randomFileName}}\",\n \"published_at\": \"2023-07-07T00:00:00Z\",\n \"edition\": \"1\",\n \"description\": \"description here\",\n \"genre\": \"B\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:3000/books/1",
"host": [
"localhost"
],
"port": "3000",
"path": [
"books",
"1"
]
}
},
"response": []
},
{
"name": "Delete Book",
"request": {
"method": "DELETE",
"header": [],
"url": {
"raw": "localhost:3000/books/2",
"host": [
"localhost"
],
"port": "3000",
"path": [
"books",
"2"
]
}
},
"response": []
},
{
"name": "Show Book",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "localhost:3000/books/1",
"host": [
"localhost"
],
"port": "3000",
"path": [
"books",
"1"
]
}
},
"response": []
}
]
},
{
"name": "Collection",
"item": [
{
"name": "Create Collection",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"name\" : \"collection - 1\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:3000/collections",
"host": [
"localhost"
],
"port": "3000",
"path": [
"collections"
]
}
},
"response": []
},
{
"name": "Show Collection",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "localhost:3000/collections/1",
"host": [
"localhost"
],
"port": "3000",
"path": [
"collections",
"1"
]
}
},
"response": []
},
{
"name": "Update Collection",
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"name\" : \"update - 1\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:3000/collections/1",
"host": [
"localhost"
],
"port": "3000",
"path": [
"collections",
"1"
]
}
},
"response": []
},
{
"name": "Delete Collection",
"request": {
"method": "DELETE",
"header": [],
"url": {
"raw": "localhost:3000/collections/2",
"host": [
"localhost"
],
"port": "3000",
"path": [
"collections",
"2"
]
}
},
"response": []
},
{
"name": "Add Book To Collection",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"bookId\" : 1\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:3000/collections/1/books",
"host": [
"localhost"
],
"port": "3000",
"path": [
"collections",
"1",
"books"
]
}
},
"response": []
},
{
"name": "Show Book Of Collection",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "localhost:3000/collections/1/books",
"host": [
"localhost"
],
"port": "3000",
"path": [
"collections",
"1",
"books"
]
}
},
"response": []
},
{
"name": "Remove Book From Collection",
"request": {
"method": "DELETE",
"header": [],
"url": {
"raw": "localhost:3000/collections/1/books/1",
"host": [
"localhost"
],
"port": "3000",
"path": [
"collections",
"1",
"books",
"1"
]
}
},
"response": []
}
]
}
]
}