# Testing using Postman

# Test create endpoint

# Request

Method: POST

Endpoint route:

http://localhost:8000/api/blogs

Body:

{
  "authorId": "65e4ebad04ace0644fb3292f",
  "categoryId": "65e4ebad04ace0628fb3292f",
  "readTime": "5min",
  "title": "Test Blog",
  "description": "This is the first test blog",
  "image": "https://www.freecodecamp.org/news/content/images/size/w2000/2021/09/radowan-nakif-rehan-cYyqhdbJ9TI-unsplash.jpg",
  "content": [
    {
      "title": "Introduction",
      "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
    },
    {
      "title": "Body",
      "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
    },
    {
      "title": "Conclusion",
      "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
    }
  ]
}

# Response

Status: 200

Body:

{
  "message": "New blog created!",
  "data": {
    "authorId": "65e4ebad04ace0644fb3292f",
    "categoryId": "65e4ebad04ace0628fb3292f",
    "readTime": "5min",
    "title": "Test Blog",
    "description": "This is the first test blog",
    "image": "https://www.freecodecamp.org/news/content/images/size/w2000/2021/09/radowan-nakif-rehan-cYyqhdbJ9TI-unsplash.jpg",
    "content": [
      {
        "title": "Introduction",
        "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      },
      {
        "title": "Body",
        "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      },
      {
        "title": "Conclusion",
        "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      }
    ],
    "_id": "65e4ebad04ace0648fb3292f",
    "__v": 0
  }
}

# Test get endpoints

# Request

Method: GET

Endpoint route:

http://localhost:8000/api/blogs

# Response

Status: 200

Body:

{
  "message": "Return all blogs!",
  "data": [
    {
      "_id": "65e4ebad04ace0648fb3292f",
      "authorId": "65e4ebad04ace0644fb3292f",
      "categoryId": "65e4ebad04ace0628fb3292f",
      "readTime": "5min",
      "title": "Test Blog",
      "description": "This is the first test blog",
      "image": "https://www.freecodecamp.org/news/content/images/size/w2000/2021/09/radowan-nakif-rehan-cYyqhdbJ9TI-unsplash.jpg",
      "content": [
        {
          "title": "Introduction",
          "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
        },
        {
          "title": "Body",
          "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
        },
        {
          "title": "Conclusion",
          "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
        }
      ],
      "__v": 0
    }
  ]
}

# Request

Method: GET

Endpoint route:

http://localhost:8000/api/blogs/[id_returned_from_create_request]

# Response

Status: 200

Body:

{
  "message": "Return blog by ID!",
  "data": {
    "_id": "65e4ebad04ace0648fb3292f",
    "authorId": "65e4ebad04ace0644fb3292f",
    "categoryId": "65e4ebad04ace0628fb3292f",
    "readTime": "5min",
    "title": "Test Blog",
    "description": "This is the first test blog",
    "image": "https://www.freecodecamp.org/news/content/images/size/w2000/2021/09/radowan-nakif-rehan-cYyqhdbJ9TI-unsplash.jpg",
    "content": [
      {
        "title": "Introduction",
        "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      },
      {
        "title": "Body",
        "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      },
      {
        "title": "Conclusion",
        "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      }
    ],
    "__v": 0
  }
}

# Test update endpoint

# Request

Method: PUT

Endpoint route:

http://localhost:8000/api/blogs/[id_returned_from_create_request]

Body:

{
  "authorId": "65e4ebad04ace0644fb3292f",
  "categoryId": "65e4ebad04ace0628fb3292f",
  "readTime": "10min",
  "title": "Test Blog",
  "description": "This is the first test blog",
  "image": "https://www.freecodecamp.org/news/content/images/size/w2000/2021/09/radowan-nakif-rehan-cYyqhdbJ9TI-unsplash.jpg",
  "content": [
    {
      "title": "Introduction",
      "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
    },
    {
      "title": "Body",
      "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
    },
    {
      "title": "Conclusion",
      "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
    }
  ]
}

# Response

Status: 200

Body:

{
  "message": "New blog created!",
  "data": {
    "authorId": "65e4ebad04ace0644fb3292f",
    "categoryId": "65e4ebad04ace0628fb3292f",
    "readTime": "5min",
    "title": "Test Blog",
    "description": "This is the first test blog",
    "image": "https://www.freecodecamp.org/news/content/images/size/w2000/2021/09/radowan-nakif-rehan-cYyqhdbJ9TI-unsplash.jpg",
    "content": [
      {
        "title": "Introduction",
        "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      },
      {
        "title": "Body",
        "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      },
      {
        "title": "Conclusion",
        "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
      }
    ],
    "_id": "65e4ebad04ace0648fb3292f",
    "__v": 0
  }
}

# Test delete endpoint

# Request

Method: DELETE

Endpoint route:

http://localhost:8000/api/blogs/[id_returned_from_create_request]

# Response

Status: 200

Body:

{
  "message": "Blog deleted!"
}