Skip to content

Rest api documentation

x1s edited this page Nov 16, 2011 · 8 revisions

Rest API Documentation

Login

Method Auth? URL Description
GET false /login/?user=:user&password=:password log a user in.
in case of success, you going to receive something like this:
{"idPerson":"1","token":"4ec3be34eb7219.04770401"}
or else: {"error":"wrong credentials"}
this token is to be used in all the other services that needs authentication as a parameter "token".
GET false /login/:token valid if a token still valid.
returns 200 http code in case of valid token 401 otherwise.

Profiles

Method Auth? URL Description
GET true /profile/ get all profiless
GET get different results /profile/:profile get some profile's information
POST true /profile params: . save a new profile
PUT true /profile/:profile params: . update specific profile's info
DELETE true /profile/:profile remove the profile and all it's dependencies

Gategories/Labels

Method Auth? URL Description
GET false /category/ get all categories
GET false /category?idProduct=:idProduct get all product's categories
GET false /category/:garage get all garage's categories
POST true /category params: user, category, idProduct. save a new category to some product
DELETE true /category/:id?user=:user remove some user's category if not associated with any product or garage

Garages

Method Auth? URL Description
GET false /garage/ get all garages
GET get different results /garage/:garage get some garage's information
POST true /garage params: . save a new garage
PUT true /garage/:garage params: . update specific garage's info
DELETE true /garage/:garage remove the garage and all it's dependencies

Products

Method Auth? URL Description
GET false /product/ get all products
GET false /product?cateogry=:category get all products given a category
GET false /product/:garage get all garage's products
POST true /product params: valor_esperado, descricao, nome, id_estado, id_pessoa, categories. save a new product to some product
PUT true /product/:id params: valor_esperado, descricao, nome, id_estado, id_pessoa categories. update some specific product
DELETE true /product/:id remove some product

Photos

Method Auth? URL Description
GET false /photo?photo=:photo get specific photo info
GET false /photo/:product get all product's photos
POST true /photo params: photo/product params. save a new photo to a product
DELETE true /photo/:photo remove specific photo

Take One

Method Auth? URL Description
GET false /takeone/:garage download the garage's default pdf
PUT true /takeone/:garage params: . create specific pdf with personal information

Bids

Clone this wiki locally