? Pending

User tests: Successful: Unsuccessful:

avatar carlitorweb
carlitorweb
21 Nov 2022

Summary of Changes

Adding 'featured' articles filter to the articles controller webservice-api

Testing Instructions

Make a GET call to .....api/v1/content/articles?filter[featured]=1

Actual result BEFORE applying this Pull Request

You cant filter the response by featured articles

Expected result AFTER applying this Pull Request

Response with only the articles marked as features (featured=1)

Link to documentations

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?

avatar carlitorweb carlitorweb - open - 21 Nov 2022
avatar carlitorweb carlitorweb - change - 21 Nov 2022
Status New Pending
avatar wilsonge wilsonge - change - 21 Nov 2022
Labels Added: ?
avatar carlitorweb
carlitorweb - comment - 22 Nov 2022

@wilsonge @richard67 thank you for the edit

Wonder if is possible, now that we can filtre by featured articles, can we somehow apply the fp.ordering? will complete this GET

Is already possible: api/index.php/v1/content/articles?filter[featured]=1&list[ordering]=fp.ordering&list[direction]=asc

avatar ReLater
ReLater - comment - 22 Nov 2022

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(?). Not needed. It's a GET request by default.

avatar ReLater ReLater - test_item - 22 Nov 2022 - Tested successfully
avatar ReLater
ReLater - comment - 22 Nov 2022

I have tested this item successfully on 45db7d6


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39273.

avatar carlitorweb
carlitorweb - comment - 22 Nov 2022

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

avatar ReLater
ReLater - comment - 22 Nov 2022

@carlitorweb
Thanks for clarification

avatar alikon
alikon - comment - 22 Nov 2022

please see #38798 too

avatar wilsonge
wilsonge - comment - 22 Nov 2022

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?

avatar alikon
alikon - comment - 3 Dec 2022

as #38798 has been merged this should be closed

avatar carlitorweb carlitorweb - change - 3 Dec 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-12-03 11:40:12
Closed_By carlitorweb
avatar carlitorweb carlitorweb - close - 3 Dec 2022

Add a Comment

Login with GitHub to post a comment