Swagger API Guide
Introduction
Welcome to the Swagger API Guide! This guide will help you explore and test FreeApiHub APIs directly from your browser using our interactive Swagger UI.
What is Swagger?
Swagger is a user-friendly interface for testing APIs. It displays available endpoints, how to use them, and what to expect in responses — all without writing code.
Accessing Swagger UI
To get started, open the Swagger UI for FreeApiHub: Swagger UI. You’ll see a list of available APIs organized by category.
Exploring Endpoints
Step 1: View Available APIs
When you open the Swagger UI, you’ll see a list of API categories. Each category expands to show available endpoints.
- Fetch All Data: Lists all data in a category.
- Fetch by ID: Retrieves a specific entry by its unique identifier (ID).
Step 2: Selecting an Endpoint
Click on any endpoint (like “GET /books”) to view details such as description and sample response.
Making a Request
Step 3: Executing a GET Request
No additional parameters are needed, as these endpoints either retrieve all entries or a single entry by ID. To make a request:
- For all data: Click Try it out for the endpoint (like
GET /books
) and select Execute to retrieve all data. - For a specific item: Enter the item’s ID in the provided field under the
GET /books/{id}
endpoint and click Execute.
Step 4: View the Response
Swagger displays the response with three main parts:
- Status Code: Indicates request success (e.g.,
200 OK
) or error. - Response Body: Shows JSON data retrieved from the API.
- Response Headers: Provides extra details like content type.
Tips for Using Swagger
- Explore: Test different endpoints and responses.
- Experiment: Try retrieving data for specific IDs.
- Use the Documentation: See the API Usage Guide for more details.
Quick Start
- Go to the Swagger UI.
- Choose an endpoint (e.g.,
GET /books
for all books orGET /books/{id}
for a specific book). - Click Try it out and Execute to see the response.
Conclusion
The Swagger UI allows you to easily test FreeApiHub APIs in real time. If you have any questions, feel free to reach out!
Happy testing! 🚀