Skip to content
teammixture edited this page Jun 29, 2014 · 19 revisions

Welcome to the WASHCost-tool wiki!

API

Before you can begin using the API you will need to register an account and then register your application as all endpoints are secure.

OAuth2 support allows you to use WASHCost-tool to authenticate on non-WASHCost-tool websites and applications.

Currently all endpoints return JSON.

Resources / Endpoints

GET: /api/me Returns information on the current requesting user.

GET: /api/reports Returns all (and only) "advanced" reports for the current user.

GET: /api/report/:id Returns an advanced report by id (if it belongs to the current user).

POST: /api/water/create Create a new report, if the title already exists or is missing data it will be rejected.

View all possible parameters

POST: /api/water/update/:id Update a report by id.

View all possible parameters

POST: /api/sanitation/create Create a new report for the current user, if the title already exists or is missing data it will be rejected.

View all possible parameters

POST: /api/sanitation/update/:id Update a report by id (if it belongs to the current user).

View all possible parameters

Applications & Access

Only admin users can currently add applications and supply the necessary app_id and secret via /oauth/applications. If you wish to use the API, please request access.

Additional guidance

The following information is intended to give guidance for the correct entry of data into the database:

  • All data must be correctly formatted in order to maintain the integrity of the database
  • This is an unverified API, so incorrectly formatted data may corrupt the integrity of the database
  • Note that data is fields are grouped: Service Area, Technology, Service Level.
  • Many of the fields are formatted into arrays. The number of items within an array of a group must match.
  • Arrays must not include empty entries – e.g. “” or null

Example advanced water JSON

Service area

  • status
  • country
  • currency
  • year_of_expenditure
  • region
  • town
  • area_type
  • service_management (array - expects an index number)
  • construction_financier (array - expects an index number)
  • infrastructure_operator (array - expects an index number)
  • service_responsbility (array - expects an index number)
  • standard_enforcer (array - expects an index number)
  • rehabilitation_cost_owner (array - expects an index number)
  • annual_household_income
  • household_size
  • direct_support_cost
  • indirect_support_cost

Technology

  • supply_system_technologies (array)
  • systems_number (array)
  • system_population_design (array)
  • system_population_actual (array)
  • water_source (array)
  • surface_water_primary_source (array)
  • water_treatment (tick-box array)
  • power_supply (tick-box array)
  • distribution_line_length (array)
  • actual_hardware_expenditure (array)
  • system_lifespan_expectancy (array)
  • actual_software_expenditure (array)
  • unpaid_labour (array)
  • minor_operation_expenditure (array)
  • capital_maintenance_expenditure (array)
  • loan_cost (array)
  • loan_payback_period (array)

Service level (Water)

  • service_level_name (array)
  • service_level_share (array)
  • national_accessibility_norms (array)
  • national_quantity_norms (array)
  • national_quality_norms (array)
  • national_reliability_norms (array)

Service level (Sanitation)

  • service_level_name (array)
  • service_level_share (array)
  • national_accessibility_norms (array)
  • national_use_norms (array)
  • national_reliability_norms (array)
  • national_environmental_protection_norms (array)

Clone this wiki locally