Skip to content

ajsevillano/api.uniondistribuidora.com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Slim 4 Basic restful API

Codacy Badge

Important

This API has been deprecated in favor of a new node API. There will be no further enhancements or modifications to this deprecated API.

This is a basic RESTful API designed for a customer.The API will allow you to fech information from a products and customers table in the databes and allow you to read,create and update them. Delete request is not allow at this time.

Motivation

Despite of my frontend background, I wanted to create a basic Restapi in PHP using PHP Slim 4 framework to serve as backend on some of my projects.

Installation

You can download the project in zip format or clone with:

gh repo clone ajsevillano/api.uniondistribuidora.com
  • Download and install composer from here
  • Then install all the project's dependencies:
php composer.phar update

I will create a file with the database structure and some dummy data for testing in next releases.

GET ENDPOINDS

The API will provived you some endpoints:

GET /products <- It will return a full json list of the products in the DB.
GET /products/id <- It will return an unique product based on its ID. Only
numerics IDs are allow.
GET /customers <- It will return a full json list of the customers in the DB.
GET /customers/id <- It will return an unique customer based on its ID. Only
numerics IDs are allow.

POST PRODUCTS ENDPOINDS

POST /products

You will need to send a json object to create a new item in the next format:

{
  "tipo": "type of drink",
  "marca": "Brand",
  "tamano": "Size",
  "nombre": "Name",
  "activo": "0"
}

PUT PRODUCTS ENDPOINDS

Put /products

You will need to send a json object to update an item based in its ID in the next format:

{
  "id": "an numeric id",
  "tipo": "beer",
  "marca": "Brand",
  "tamano": "Size",
  "nombre": "Name",
  "activo": "0"
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About

A RESTful API used by a drinks distribution company website based in Spain. This API is now deprecated.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published