Closed Mirror83 closed 6 months ago
We have decided to use one endpoint for filtering blogs:
The agreed query params are topic, author, period, title
I have added q param for the search term
Two dedicated endpoints for each
We will use the likes to determine trending blogs and the number of blogs with a given topic as trending topic
Currently, the get blogs website returns all of the blogs stored in the database. I think that there should be a way to filter them based on criteria such as:
I think that this should be done using query params to the get blogs site as exemplified below:
1. Get blogs of a specific topic
/api/v2/blogs?topic=Health+and+Wellness
2. Get blogs of a particular author.
/api/v2/blogs?author=glen - The value to the author param could be the username of the author
3. Get blogs by date.
This could be though about in different ways. Maybe it could be done by a specific date:
/api/v2/blogs?date=01/01/2024
Or maybe by tags defining specific time periods: /api/v2/blogs?period=today
/api/v2/blogs?period=last+week, or
/api/v2/blogs?period=last+month e.t.c
Or maybe only by month and year /api/v2/blogs?month=10&year=2023
Or some other mechanism.
4. Get trending blogs
/api/v2/blogs/trending or /api/v2/blogs?trending=true - This would be the same for topics
And the others would be similarly defined. The parameters can also be mixed and matched, for example if one wanted to find a trending blog belonging to a specific author.