Joomla 4 API Searching and Articles by Tags

155 views
Skip to first unread message

IanC

unread,
Oct 14, 2022, 6:25:27 AM10/14/22
to Joomla! General Development
Hi

I'm migrating a Joomla 3 site to Joomla 4.1 however the J!3 site has jBackend installed to provide another website access to the aricles via a restful api.

jBackend isn't supported on J!4 and looking at their support/forums its a dead project now.

So I started to look at J!4 Core API (https://docs.joomla.org/J4.x:Joomla_Core_APIs) but its either not complete enough, or I'm looking in the wrong place.

I can't see an endpoint for searching articles based on keywords or tags.
I can't see a way of listing articles based on a specified tag.

Any ideas?


Mark Stanton

unread,
Oct 23, 2022, 11:39:12 AM10/23/22
to Joomla! General Development

Ian Chilvers

unread,
Oct 28, 2022, 5:35:07 AM10/28/22
to joomla-de...@googlegroups.com
I can't see how  https://docs.joomla.org/J4.x:Adding_an_API_to_a_Joomla_Component helps.

I basically need the following end points

* Search (published) articles based on keywords
* Search/List (published) articles based on tags

The current api is fairly feature rich, just missing full search features based on the fundamentals of Joomla, like tags, published, unpublished, archived, etc...


--
You received this message because you are subscribed to a topic in the Google Groups "Joomla! General Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/joomla-dev-general/WQYgvNqJmdI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to joomla-dev-gene...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/joomla-dev-general/53a5daf1-2547-46b1-b7a6-cda072abbd27n%40googlegroups.com.

Mark Stanton

unread,
Oct 28, 2022, 6:38:44 AM10/28/22
to Joomla! General Development
My understanding of your question was that you don't know how to access API endpoints in J4 compared to J3.  That link I gave shows how to do that.  Does that help?  Now you seem to have another question.

When you say "current api", what are you referring to?

There is a full list of J4 API endpoints, https://docs.joomla.org/J4.x:Joomla_Core_APIs.  Is what you want there?

Ian Chilvers

unread,
Oct 28, 2022, 7:49:14 AM10/28/22
to joomla-de...@googlegroups.com
Hi

Apologies, I think you misunderstood my original question, and maybe I wasn't clear enough

I current have a Joomla 3 site (which as you know Joomla 3 has no native API) with a component installed called jBackend which adds a restful API feature.
With jBackend I am able to use endpoints for searching articles based on keywords and tags, then using the same API fetch the article on a 3rd party website outside of the Joomla website.

I am looking to upgrade from J!3 to J!4 but the component jBackend is no longer supported for J!4, probably because J!4 has a native API.

Looking at that native API I can't find the endpoints for searching articles based on keywords and/or tags.  That was why I created my original posting on the group.



Mark Stanton

unread,
Oct 28, 2022, 9:14:25 AM10/28/22
to Joomla! General Development
Yes, my understanding was somewhat flawed.

I was confused by your mention of jbackend, which implied to me that you coded something for this access in J3.  The (first) document I referenced shows how to implement such a thing in J4.

Looking at the api code in the articles controller, it looks for a filter array and a list array.  You don't mention these so I'm not sure if you're aware of those or not.  However there's no reference to tags or keywords.  If that's the case you'll need to code it yourself, the particular nuisance being you can't just add it to the existing articles endpoint.
Reply all
Reply to author
Forward
0 new messages