Home Feed
Retrieve all the data needed to populate the app's home screen in a single API call. This endpoint returns a personalized feed including the user's active booking (if any), nearby stations, featured vehicles, and agency announcements.
The home feed is designed to be the primary data source for the main screen of the mobile app, reducing the number of API calls needed on app launch. It aggregates multiple data sources:
- User Status: Quick check on verification completion and active bookings
- Active Booking: If the user has an ongoing rental, show it prominently
- Nearby Stations: Stations sorted by distance (if location is provided)
- Featured Vehicles: Highlighted vehicles for quick booking
- Announcements: Agency news, promotions, and important notices
This single endpoint replaces what would otherwise require 4-5 separate API calls, improving app performance and reducing network usage.
Endpoint
INFO
GET /api/v1/client/home
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
X-Agency-Signature | {signature} | Yes |
Example Request
bash
curl -X GET https://api.daakey.com/api/v1/client/home \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Agency-Signature: {signature}"Response
Success (200)
json
{
"success": true,
"message": "Home feed retrieved",
"data": {
"user": {
"id": 1,
"name": "John Doe",
"has_active_booking": true,
"verification_complete": true
},
"active_booking": {
"id": 5,
"status": "active",
"vehicle": {
"id": 1,
"plate_number": "ABC-123",
"brand": "Toyota",
"model": "Corolla",
"image": "https://api.daakey.com/storage/vehicles/1/thumb.jpg"
},
"start_date": "2024-01-15T10:00:00Z",
"end_date": "2024-01-15T18:00:00Z"
},
"nearby_stations": [
{
"id": 1,
"name": "Downtown Station",
"address": "123 Main St",
"distance_km": 0.5,
"available_vehicles": 8,
"latitude": 40.7128,
"longitude": -74.0060
},
{
"id": 2,
"name": "Airport Terminal",
"address": "456 Airport Blvd",
"distance_km": 12.3,
"available_vehicles": 15,
"latitude": 40.6413,
"longitude": -73.7781
}
],
"featured_vehicles": [
{
"id": 1,
"brand": "Toyota",
"model": "Corolla",
"category": "sedan",
"hourly_rate": 15.00,
"daily_rate": 80.00,
"image": "https://api.daakey.com/storage/vehicles/1/thumb.jpg"
},
{
"id": 2,
"brand": "Tesla",
"model": "Model 3",
"category": "electric",
"hourly_rate": 25.00,
"daily_rate": 150.00,
"image": "https://api.daakey.com/storage/vehicles/2/thumb.jpg"
}
],
"announcements": [
{
"id": 1,
"title": "New Electric Vehicles",
"message": "Check out our new Tesla Model 3 fleet!",
"type": "info",
"created_at": "2024-01-10T00:00:00Z"
}
]
},
"meta": {
"agency_id": 123,
"agency_code": "AGENCY123"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Returns personalized content based on user location (if provided)
- Active booking is included if one exists
- Nearby stations are sorted by distance