This function sends an API request to the Ecopi API with the specified resource, parameters, and optional arguments.
Arguments
- resource
A character string specifying the API resource to request.
- ...
Path parameters, that point to a specific resource, to be passed to the req_template() function.
- params
Query parameters that modify the reuqest.
- new_data
A named list of parameters to be updated/ patched.
- file_path
A path currently only important to patch an image to a recorder endpoint (Watchout! If file_path given, new_data gets ignored (cannot patch multiple types)).
Examples
if (FALSE) { # \dontrun{
# Send a request to the 'detections' endpoint. Only get detections in the project '017_neeri'
response <- ecopi_api("GET /detections/", params = list("project" = "017_neeri"))
} # }