Giter Site home page Giter Site logo

boojbooklist's Introduction

Booj's Book List API

About the API

This is a Restful API for the Booj's Book List project. It was built in Laravel, a PHP framework. It provides data about Books, their author, and publication date. Users can receive data through a GET request, add a book to the API through a POST request, and delete a book with a DELETE request.

/api/book

GET

Making a GET request to this endpoint returns all books

Data returned for each book includes:

  • id
  • title
  • author
  • publication (year)
  • creation timestamp
  • update timestamp

Example of returned JSON:

[
   {
     "id": 40,
     "title": "Price Prairie",
     "author": "Marques",
     "publication": "1994",
     "created_at": "2019-10-23 19:57:47",
     "updated_at": "2019-10-23 19:57:47"
    },
    {
      "id": 41,
      "title": "Truth & Method",
      "author": "Gadamer",
      "publication": "1923",
      "created_at": "2019-10-23 20:49:06",
      "updated_at": "2019-10-23 20:49:06"
     },
     {
      "id": 42
      "title": "String Cheese Is Bad",
      "author": "The String Cheese Incident",
      "publication": "2001",
      "created_at": "2019-10-23 20:58:22",
      "updated_at": "2019-10-23 20:58:22"
     }    
 ]

POST

Making a POST request to this endpoint with adds a book to the database.

Required:

A correctly formatted book object must be provided in the request body in order to post to the database.

Example of correctly formatted book object:

{ title: <STRING>, author: <STRINGr>, publication: <STRING>  }
{
	"title": "Truth & Method",
	"author": "Gadamer",
	"publication": "1923"
	
}

/api/book/:id

DELETE

Making a DELETE request to this endpoint deletes a book with the specified id.

Required:

An id that corresponds to a book present in the database must be provided in the URL.

URL with specified id:

http://127.0.0.1:8000/api/book/23

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.