Rest Api Overview

Let's cover the REST API we are to build!

Endpoints

Restaurants

GET /restaurants Search for restaurants with filters

  • Query Parameters:
    • q: Search query string
    • latitude & longitude: Location coordinates
    • radius: Search radius in km
    • cuisineType: Filter by cuisine
    • minRating: Minimum rating (1-5)
    • page: Page number (default: 1)
    • size: Results per page (1-100, default: 20)

POST /restaurants Create a new restaurant

  • Auth required
  • Request: Restaurant details including name, cuisine type, address, location, operating hours

GET /restaurants/{restaurantId} Get detailed information about a specific restaurant

PUT /restaurants/{restaurantId} Update restaurant details

  • Auth required

Reviews

GET /restaurants/{restaurantId}/reviews Get reviews for a restaurant

  • Query Parameters:
    • sort: date,desc, date,asc, rating,desc, rating,asc (default: date,desc)
    • page: Page number (default: 1)
    • size: Results per page (1-50, default: 20)

POST /restaurants/{restaurantId}/reviews Create a review

  • Auth required
  • Request: Review content, rating (1-5), optional photo IDs
  • Note: Users can only review a restaurant once

PUT /reviews/{reviewId} Update a review

  • Auth required
  • Restrictions: Can only update within 48 hours of posting
  • Request: Updated content, rating, optional photo IDs

Photos

POST /photos Upload a photo

  • Auth required
  • Content-Type: multipart/form-data
  • Fields:
    • file: Image file
    • caption: Optional photo caption

Each paginated response includes metadata with:

  • current page number
  • page size
  • total elements
  • total pages

Summary

  • The REST API allows for managing Restaurants, Reviews and Photos
  • The REST API provide a solid base, but may need to be extended during development
© 2026 Devtiro Ltd. All rights reserved