GithubHelp home page GithubHelp logo

connectronic-api's Introduction

Connectronic API

Documentation

API REST created to returned Category CRUD.

Index Categories

Returns json data about a multi categories.

  • URL

    /categories

  • Method:

    GET

  • URL Params

    Required:

    None

  • Data Params

    None

  • Success Response:

    • Code: 200
      Content: [{ id : 12, name : "Limpeza", description : "Produtos de Limpeza" }]
  • Error Response:

    • Code: 404 NOT FOUND
      Content: { error : "Categories doesn't exist" }
  • Sample Call:

      $.ajax({
        url: "/categories",
        dataType: "json",
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });

Show Category

Returns json data about a single category.

  • URL

    /categories/:id

  • Method:

    GET

  • URL Params

    Required:

    id=[integer]

  • Data Params

    None

  • Success Response:

    • Code: 200
      Content: { id : 12, name : "Limpeza", description : "Produtos de Limpeza" }
  • Error Response:

    • Code: 404 NOT FOUND
      Content: { error : "Category doesn't exist" }
  • Sample Call:

      $.ajax({
        url: "/categories/12",
        dataType: "json",
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });

Store Category

Returns json data about a single category.

  • URL

    /categories

  • Method:

    POST

  • URL Params

    Required:

    name=[string]

  • Data Params

    name=[string]

    description=[string]

  • Success Response:

    • Code: 200
      Content: { id : 12, name : "Limpeza", description : "Produtos de Limpeza" }
  • Error Response:

    • Code: 404 NOT FOUND
      Content: { error : "Category doesn't exist" }
  • Sample Call:

      $.ajax({
        url: "/categories",
        dataType: "json",
        type : "POST",
        success : function(r) {
          console.log(r);
        }
      });

Update Category

Returns json data about a single category.

  • URL

    /categories/:id

  • Method:

    POST

  • URL Params

    Required:

    id=[integer]

    name=[string]

  • Data Params

    name=[string]

    description=[string]

  • Success Response:

    • Code: 200
      Content: { id : 12, name : "Limpeza", description : "Produtos de Limpeza" }
  • Error Response:

    • Code: 404 NOT FOUND
      Content: { error : "Category doesn't exist" }
  • Sample Call:

      $.ajax({
        url: "/categories/12",
        dataType: "json",
        type : "PUT",
        success : function(r) {
          console.log(r);
        }
      });

Destroy Category

Returns nothing data.

  • URL

    /categories/:id

  • Method:

    DELETE

  • URL Params

    Required:

    id=[integer]

  • Data Params

    None

  • Success Response:

    • Code: 200
      Content: None
  • Error Response:

    • Code: 404 NOT FOUND
      Content: { error : "Category doesn't exist" }
  • Sample Call:

      $.ajax({
        url: "/categories/12",
        dataType: "json",
        type : "DELETE",
        success : function(r) {
          console.log(r);
        }
      });

connectronic-api's People

Watchers

James Cloos avatar José Rodolfo avatar

connectronic-api's Issues

Setup Project

  • Setup packages
  • Setup express api
  • Connect database

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.