TrailTracker REST API

Complete API documentation for TrailTracker integration

API Overview

Base URL:

https://api.trailtracker.app/v1

Content Type:

Content-Type: application/json

Authentication:

Protected endpoints require a Bearer token in the Authorization header.

Adventure Endpoints

GET
/adventures

Get all adventures (with optional filtering)

Full URL:

https://api.trailtracker.app/v1/adventures

Query Parameters:

{
  "is_public": "true",
  "activity_type": "hiking",
  "limit": "20",
  "offset": "0"
}

Response:

[
  {
    "id": "adv_123",
    "title": "Summit of Mount Awesome",
    "description": "Amazing hike with great views",
    "activity_type": "hiking",
    "status": "completed",
    "is_public": true,
    "location": "Rocky Mountains",
    "difficulty": "moderate",
    "created_by": "user@example.com",
    "created_date": "2024-01-15T10:30:00Z",
    "stats": {
      "total_distance": 12.5,
      "total_time": 240,
      "elevation_gain": 800,
      "elevation_loss": 750
    },
    "route_data": {
      "start_lat": 40.7128,
      "start_lng": -74.006,
      "waypoints": []
    },
    "likes_count": 15,
    "comments_count": 3
  }
]
GET
/adventures/{id}

Get a specific adventure by ID

Full URL:

https://api.trailtracker.app/v1/adventures/{id}

Response:

{
  "id": "adv_123",
  "title": "Summit of Mount Awesome",
  "description": "Amazing hike with great views",
  "activity_type": "hiking",
  "status": "completed",
  "is_public": true,
  "location": "Rocky Mountains",
  "difficulty": "moderate",
  "created_by": "user@example.com",
  "created_date": "2024-01-15T10:30:00Z",
  "stats": {
    "total_distance": 12.5,
    "total_time": 240,
    "elevation_gain": 800,
    "elevation_loss": 750
  },
  "route_data": {
    "start_lat": 40.7128,
    "start_lng": -74.006,
    "waypoints": [
      {
        "lat": 40.7128,
        "lng": -74.006,
        "elevation": 100,
        "timestamp": "2024-01-15T10:30:00Z",
        "type": "start"
      }
    ]
  },
  "media": [
    {
      "type": "photo",
      "url": "https://cdn.trailtracker.app/photos/123.jpg",
      "waypoint_index": 0,
      "caption": "Starting the hike!"
    }
  ],
  "likes_count": 15,
  "comments_count": 3
}
POST
/adventures

Create a new adventure

Full URL:

https://api.trailtracker.app/v1/adventures

Authentication Required:

Authorization: Bearer YOUR_TOKEN_HERE

Request Body:

{
  "title": "New Adventure",
  "description": "Great trail experience",
  "activity_type": "hiking",
  "location": "Mountain Trail",
  "difficulty": "moderate",
  "status": "completed",
  "is_public": true,
  "route_data": {
    "waypoints": [
      {
        "lat": 40.7128,
        "lng": -74.006,
        "elevation": 100,
        "timestamp": "2024-01-15T10:30:00Z"
      }
    ]
  },
  "stats": {
    "total_distance": 5.2,
    "total_time": 120,
    "elevation_gain": 300
  }
}

Response:

{
  "id": "adv_124",
  "title": "New Adventure",
  "created_date": "2024-01-15T12:00:00Z",
  "message": "Adventure created successfully"
}
PUT
/adventures/{id}

Update an existing adventure

Full URL:

https://api.trailtracker.app/v1/adventures/{id}

Authentication Required:

Authorization: Bearer YOUR_TOKEN_HERE

Request Body:

{
  "title": "Updated Adventure Title",
  "description": "Updated description",
  "is_public": false
}

Response:

{
  "id": "adv_123",
  "message": "Adventure updated successfully"
}
DELETE
/adventures/{id}

Delete an adventure

Full URL:

https://api.trailtracker.app/v1/adventures/{id}

Authentication Required:

Authorization: Bearer YOUR_TOKEN_HERE

Response:

{
  "message": "Adventure deleted successfully"
}
Common Error Responses

400 Bad Request:

{
  "error": "Invalid request data",
  "message": "Title is required"
}

401 Unauthorized:

{
  "error": "Unauthorized",
  "message": "Invalid or missing authentication token"
}

404 Not Found:

{
  "error": "Not found",
  "message": "Adventure not found"
}

We use cookies to improve your experience and analyse site usage. By clicking "Accept all cookies" you consent to our use of cookies. Privacy Policy