User tests: Successful: Unsuccessful:
Adding 'featured' articles filter to the articles controller webservice-api
Make a GET call to .....api/v1/content/articles?filter[featured]=1
You cant filter the response by featured articles
Response with only the articles marked as features (featured=1)
Update https://docs.joomla.org/J4.x:Joomla_Core_APIs by adding a new endpoint: /api/index.php/v1/content/articles?filter[featured]=1 Maybe add the others filters too?
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Addition to the test instructions: For stupid people like me who use a Linux console and token authentication: you have to mask the square brackets for filter
with backslashes. For example:
curl -H "Authorization: Bearer MY_AUTH_TOKEN" "https://example.org/api/index.php/v1/content/articles?filter\[featured\]=1"
I have absolutely no idea where to insert the Not needed. It's a GET request by default.GET
if that's important for successful testing(?).
I have tested this item
Addition to the test instructions: For stupid people like me who use a Linux console and token authentication: you have to mask the square brackets for
filter
with backslashes. For example:
curl -H "Authorization: Bearer MY_AUTH_TOKEN" "https://example.org/api/index.php/v1/content/articles?filter\[featured\]=1"
I have absolutely no idea where to insert the
GET
if that's important for successful testing(?).
Addition to the test instructions: For stupid people like me who use a Linux console and token authentication: you have to mask the square brackets for
filter
with backslashes. For example:
curl -H "Authorization: Bearer MY_AUTH_TOKEN" "https://example.org/api/index.php/v1/content/articles?filter\[featured\]=1"
I have absolutely no idea where to insert the
GET
if that's important for successful testing(?).
Thank for add the test instructions.
About the GET
was more like to be explicit, for example for those who use some vscode extension like Thunder Client for HTTP request where you need choose between GET, POST etc , Is not needed in your case
@carlitorweb
Thanks for clarification
Given this is a boolean would it make more sense to use the strings true and false for the api and have the controller convert them into int's? not sure if we've already set precedents elsewhere in the api?
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-12-03 11:40:12 |
Closed_By | ⇒ | carlitorweb |
@wilsonge @richard67 thank you for the edit
Wonder if is possible, now that we can filtre by featured articles, can we somehow apply thefp.ordering
? will complete this GETIs already possible:
api/index.php/v1/content/articles?filter[featured]=1&list[ordering]=fp.ordering&list[direction]=asc