Skip to content
Justin Forest edited this page Apr 13, 2024 · 16 revisions

Table of Contents:

Add a tree

Example request:

POST /v1/trees HTTP/1.0
Authorization: Bearer ..token..

{
  "lat": 1.2,
  "lon": 3.4,
  "name": "Big Oak",
  "height": 25.0,
  "circumference": "3.72",
  "diameter": "15",
  "state": "healthy",
}

Example response:

202 OK HTTP/1.1

Get tree details

Example request:

GET /v1/trees/123 HTTP/1.0

Example response:

200 OK HTTP/1.0
Content-Type: application/json

{
  "lat": 1.2,
  "lon": 3.4,
  "name": "Big Oak",
  "height": 25.0,
  "circumference": "3.72",
  "diameter": "15",
  "state": "healthy",
}

List trees

Example request:

GET /v1/trees HTTP/1.0

Example response:

{
  "trees": [
    {
      "id": 1,
      "lat": 37.7749,
      "lon": -122.4194
    },
    {
      "id": 2,
      "lat": 37.7749,
      "lon": -122.4194
    },
    {
      "id": 3,
      "lat": 37.7749,
      "lon": -122.4194
    }
  ]
}
Clone this wiki locally