API REST para el manejo de datos de pozos y piezómetros de CORALINA
Version: 1.0.0
This API provides access to water resource management data for CORALINA (Corporación para el Desarrollo Sostenible del Archipiélago de San Andrés, Providencia y Santa Catalina). It allows you to retrieve, create, update, and delete information about water wells (pozos), piezometers, and calculate water usage fees (TUA).
http://mrd2.co/Coralina-Back-End/services/
Retrieves a list of all wells in the system.
http://mrd2.co/Coralina-Back-End/services/pozos/get.php
Retrieves details of a specific well by its internal ID.
id (integer) - The internal ID of the wellhttp://mrd2.co/Coralina-Back-End/services/pozos/getById.php?id=1
Retrieves details of a specific well by its PCOZO ID.
id_pcozo (string) - The PCOZO ID of the wellhttp://mrd2.co/Coralina-Back-End/services/pozos/getByIdPozo.php?id_pcozo=PC3
Creates a new well record.
{
"id_pcozo": "PC123",
"tipo_pozo": 1,
"cota": 19.790,
"latitud": 12.570280,
"longitud": -81.709290,
"responsable": "Juan Antonio González",
"fm_acuifera": "Fm San Luis",
"cmp": 2.5,
"rb": 24.0,
"observaciones": "Nuevo pozo de prueba"
}
Updates an existing well record.
id (integer) - The internal ID of the well to updateSame as create.php
Deletes a well record.
id (integer) - The internal ID of the well to deleteRetrieves historical data for all wells.
Retrieves the last two historical records for a specific well by internal ID.
id_pozo (integer) - The internal ID of the wellRetrieves the last two historical records for a specific well by PCOZO ID.
id_pcozo (string) - The PCOZO ID of the wellRetrieves a list of all piezometers in the system.
Retrieves historical data for all piezometers.
Updates an existing piezometer record by internal ID.
id (integer) - The internal ID of the piezometer{
"nombre_comun": "Piezometro Test",
"red": "Red Principal",
"cota": 123.45,
"alto_pto_toma": 45.67,
"profundidad": 89.12,
"tipo_fuente": "Tipo A",
"x_utm": 123456.78,
"y_utm": 987654.32,
"x_local": 234.56,
"y_local": 789.01
}
Updates an existing piezometer record by piezometer ID.
id_piezometro (string) - The ID of the piezometerSame as update.php
Calculates the water usage fee based on provided parameters.
tmLastYear (float) - Tasa mínima del año anterioripc (float) - Índice de precios al consumidorcpmLastYear (float) - Costo del programa de monitoreo del año anteriornbi (float) - Necesidades básicas insatisfechascu1 (float) - Coeficiente de uso 1cu2 (float) - Coeficiente de uso 2http://mrd2.co/Coralina-Back-End/services/TUA/getTUA.php?tmLastYear=1.5&ipc=0.05&cpmLastYear=1000&nbi=25&cu1=0.8&cu2=0.5
Retrieves the MADS (Ministerio de Ambiente y Desarrollo Sostenible) report for a specific year.
vigencia (integer) - The year for which to generate the reportYou can make requests to this API using any HTTP client, such as:
To retrieve all wells, make a GET request to:
http://mrd2.co/Coralina-Back-End/services/pozos/get.php
To create a new well, make a POST request to:
http://mrd2.co/Coralina-Back-End/services/pozos/create.php
With a JSON body containing the well data (see the endpoint documentation above).
All API responses are in JSON format with the following structure:
{
"status": "success" or "error",
"data": [...] or {...}, // Present when status is "success"
"message": "Error message" // Present when status is "error"
}
When an error occurs, the API will return a JSON response with status "error" and a message describing the error.
{
"status": "error",
"message": "Description of the error"
}
Common error scenarios include: