Here is an example of a detailed wiki for your API service:
This API service is built using Dart and provides motivational quotes organized into various categories and subcategories. The service allows users to fetch quotes by different criteria, such as by quote ID, by author, and by category.
To get started with the Dart API Service, you will need Dart installed on your machine. Clone the repository and run the following commands to start the server:
git clone https://github.com/yourusername/yourrepository.git
cd yourrepository
dart run bin/server.dart
The server will start on http://localhost:8080
.
Endpoint: /categories
Method: GET
Description: Returns a list of all categories with their IDs.
Response:
{
"categories": [
{"id": 11, "name": "Self-Improvement"},
{"id": 12, "name": "Motivation"}
// more categories
]
}
Endpoint: /categories/{categoryName}/subcategories
Method: GET
Description: Returns a list of subcategories for a given category name along with their IDs.
Response:
{
"subcategories": [
{"id": 111, "name": "Personal Growth"},
{"id": 112, "name": "Learning and Education"}
// more subcategories
]
}
Endpoint: /quotes/{quoteId}
Method: GET
Description: Returns the quote with the specified ID.
Response:
{
"quote": {
"id": "2406",
"text": "Personal growth is not a matter of learning new information but unlearning old limits.",
"author": "Anonymous"
}
}
Endpoint: /authors
Method: GET
Description: Returns a list of all unique authors.
Response:
{
"authors": ["Anonymous", "Steve Jobs", "Eleanor Roosevelt"]
}
Endpoint: /quotes/author/{authorName}
Method: GET
Description: Returns all quotes by the specified author.
Response:
{
"quotes": [
{
"id": "2406",
"text": "Personal growth is not a matter of learning new information but unlearning old limits.",
"author": "Anonymous"
},
{
"id": "2415",
"text": "Your time is limited, don’t waste it living someone else’s life.",
"author": "Steve Jobs"
}
// more quotes
]
}
We welcome contributions to improve the API service. Please follow these steps to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch-name
. - Make your changes and commit them:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin feature-branch-name
. - Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.