Skip to content

Rest api documentation

x1s edited this page Jan 7, 2012 · 8 revisions

Rest API Documentation

Login

Method Auth? URL
GET false /login/?user=:user&password=:password

log a user in.

in case of success

http 200 code
{"idPerson":"1","token":"4ec3be34eb7219.04770401"}
* this token is aim to be used in all services that requires "token" as a authentication parameter.

in case of any credential error

http 401 code
{"message":"wrong credentials"}

any other error

http 400 code
{"message":"invalid params"}

</td> 
GET false /login/:token
valid if a token still valid.

it is a valid session token

returns "true" and a 200 http code

it ha expired, invalid or any other related issue

returns false and a 401 http code.

GET false /login/recover?email=:email
password recover

email with new password was sent

returns "true" and a 200 http code

any error

returns false and a 400 http code.

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