Skip to content
Snippets Groups Projects
  1. Sep 02, 2016
  2. Sep 01, 2016
  3. Aug 31, 2016
  4. Aug 11, 2016
  5. Aug 09, 2016
  6. Aug 08, 2016
  7. Jul 27, 2016
  8. Jul 26, 2016
  9. Jul 25, 2016
  10. Jul 12, 2016
    • Vytor Calixto's avatar
      Change nodemon to forever in package.json · 7e732f91
      Vytor Calixto authored
      7e732f91
    • Vytor Calixto's avatar
      Merge branch 'add_basic_queries' into 'development' · aed7f882
      Vytor Calixto authored
      Implement basic queries for enrollments
      
      # Description
      
      Implemented enrollments queries per:
      - Region
      - State
      - City
      
      The *census_year* parameter is *mandatory* and should be included in all requests.
      
      The "/enrollments" route supports the following parameters
      
      - aggregate: metric to aggregate, can be {state, region, city}. When no parameter is supplied or the parameter is not supported, the API assumes the whole country.
      - id: record identifer of the metric to aggregate (e.g. one specific state or region), it only applies when the aggregate parameters is passed and is valid. Again, when no parameter is specified, the API assumes the whole range of values the metric can take (e.g. all states or all regions).
      - adm_dependency_id: administrative dependency identifier, the possible values are shown in the Table 1.
      
      - location_id: location identifier, its possible values are given in Table 2.
      
      # Tables
      
      *Table 1:* Administrative dependency table.
      
      | adm_dependency_id | name           |
      |---------------------------|---------------|
      | 0                                          | All records  |
      | 1                                          | Federal        |
      | 2                                          | Estadual     |
      | 3                                          | Municipal   |
      | 4                                           | Privada       |
      
      *Table 2:* Location table.
      
      | location_id  | name            |
      |----------------|---------------|
      | 0                        | All records  |
      | 1                        | Urbana        |
      | 2                        | Rural            |
      
      # Response Format
      
      The API returns a JSON array with name "result" where every array has following attributes:
      - name: Name of the metric (e.g. name of a state, city or region)
      - total: Total number of enrollments for the selected metric and given parameters.
      
      # Examples
      Retrieve the number of enrollments of 2014 for the whole country:
      > /api/v1/enrollments?census_year=2014
      
      Retrieve the number of enrollments of 2013 for a given region:
      > /api/v1/enrollments?census_year=2013&aggregate=region&id=1
      
      Retrieve the number of enrollments of 2012 for all rural locations in the state of Paraná:
      > /api/v1/enrollments?census_year=2012&aggregate=state&id=41&location_id=2
      
      Retrieve the number of enrollments of 2012 for the North region:
      > /api/v1/enrollments?census_year=2012&aggregate=region&id=1
      
      See merge request !5
      aed7f882
    • Vytor Calixto's avatar
      4a54e770
    • Vytor Calixto's avatar
      Fix XML response in /enrollments · 42709f1b
      Vytor Calixto authored
      42709f1b
  11. Jul 11, 2016
  12. Jul 08, 2016
  13. Jul 07, 2016
Loading