Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
Sergio Infante edited this page Apr 13, 2016 · 27 revisions

Backend Belatrix AllStars

This document is under construction.

Endpoints reference

Documentation

/api/docs/

  • Expected result: Swagger API Documentation (web browser)

Swagger API

Employee

/api/employee/authenticate/

  • Method: POST
  • Parameters: username=usuario&password=clave
  • Expected result: Authentication flow, return token and user_id
  • Example:

curl -X POST -d "username=usuario&password=clave" http://localhost:8000/api/employee/authenticate/

/api/employee/list/

  • Method: GET
  • Expected result: Employee complete list
  • Example:

curl -X GET http://localhost:8000/api/employee/list/

/api/employee/list/top/{kind}/{quantity}/

  • Method: GET
  • Header: Authorization(Token <token_number>)
  • Parameters: {kind}(level, top), {quantity}(number of results)
  • Expected result: Employee top level or top score list
  • Example:

curl -X GET http://localhost:8000/api/employee/top/level/1/ -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'

/api/employee/{employee_id}/

  • Method: GET
  • Parameters: {employee_id}(employee primary key or id)
  • Expected result: Employee detail
  • Example:

curl -X GET http://localhost:8000/api/employee/1/

/api/employee/{employee_id}/avatar/

  • Method: GET
  • Parameters: {employee_id}(employee primary key or id)
  • Expected result: Employee avatar
  • Example:

curl -X GET http://localhost:8000/api/employee/1/avatar/

/api/employee/{employee_id}/category/list/

  • Method: GET
  • Parameters: {employee_id}(employee primary key or id)
  • Expected result: Categories allowed to give stars from employees.
  • Example:

curl -X GET http://localhost:8000/api/employee/1/category/list/

Category

/api/category/{category_id}/subcategory/list/

  • Method: GET
  • Parameters: {category_id}(category primary key or id)
  • Expected result: Subcategory list of Categories.
  • Example:

curl -X GET http://localhost:8000/api/category/1/subcategory/list/

Stars

/api/stars/{employee_id}/list/

  • Method: GET
  • Parameters: {employee_id}(employee primary key or id)
  • Expected result: Employee stars list.
  • Example:

curl -X GET http://localhost:8000/api/stars/1/list/

/api/stars/{employee_id}/give/star/to/{employee_id}/

  • Method: POST
  • Parameters: {employee_id}(employee primary key or id), comment=comentario&subcategory_id=1
  • Expected result: Employee give star to Employee by Id and save comments and subcategory.
  • Example:

curl -X POST -d "comment=comentario&subcategory=1" http://localhost:8000/api/stars/1/give/star/to/2/

Search

/api/search?parameters

  • Method: GET
  • Parameters: search terms
  • Expected result: Employee list using search parameters.
  • Example:

curl -X GET http://localhost:8000/api/search?parameters

Clone this wiki locally