Git Product home page Git Product logo

go-crud-api's Introduction

This is a Go based CRUD API to store and process movies

API Documentation

1. GET ALL MOVIES

  • Base URL: https://go-crud-api.cleverapps.io
  • Endpoint: /movies
  • Method: GET
  • Example Response:
    200 OK
    [
      {
          "id": "2",
          "isbn": "831479",
          "title": "Inception",
          "director": {
              "firstName": "Christopher",
              "lastName": "Nolan"
          }
      },
      {
          "id": "3",
          "isbn": "15740661",
          "title": "Avatar",
          "director": {
              "firstName": "James",
              "lastName": "Cameron"
          }
      }
    ]
    

2. GET MOVIE BY ID

  • Base URL: https://go-crud-api.cleverapps.io
  • Endpoint: /movies/[id: numeric string]
  • Method: GET
  • Example Request: /movies/2
  • Example Successful Response:
    200 OK
    {
      "id": "2",
      "isbn": "831479",
      "title": "Inception",
      "director": {
          "firstName": "Christopher",
          "lastName": "Nolan"
      }
    }
    
  • Example Unsuccessful Response: 404 NOT FOUND

3. CREATE MOVIE

  • Base URL: https://go-crud-api.cleverapps.io
  • Endpoint: /movies
  • Method: POST
  • Example Request Body:
    {
      "title": "movie_name",
      "director": {
          "firstName": "director_first_name",
          "lastName": "director_last_name"
      }
    }
    
  • Example Successful Response:
    200 OK
    {
      "id": "3", // plain counter
      "isbn": "831479", //random
      "title": "movie_name",
      "director": {
          "firstName": "director_first_name",
          "lastName": "director_last_name"
      }
    }
    

4. UPDATE MOVIE

  • Base URL: https://go-crud-api.cleverapps.io
  • Endpoint: /movies/[id: numeric string]
  • Method: PUT
  • Exmaple Request Query: /movies/4
  • Example Request Body:
    {
      "title": "updated_movie_name",
      "director": {
          "firstName": "updated_director_first_name",
          "lastName": "updated_director_last_name"
      }
    }
    
  • Example Successful Response:
    200 OK
    {
      "id": "4", // unchanged
      "isbn": "831479", // unchanged
      "title": "updated_movie_name",
      "director": {
          "firstName": "updated_director_first_name",
          "lastName": "updated_director_last_name"
      }
    }
    
  • Example Unsuccessful Response: 404 NOT FOUND

5. DELETE MOVIE

  • Base URL: https://go-crud-api.cleverapps.io
  • Endpoint: /movies/[id: numeric string]
  • Method: DELETE
  • Exmaple Request Query: /movies/4
  • Example Successful Response: 200 OK
  • Example Unsuccessful Response: 404 NOT FOUND

go-crud-api's People

Contributors

moonman369 avatar

Watchers

 avatar  avatar

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.