New to Joomla, Beginning to use the API

86 views
Skip to first unread message

The Hobbit

unread,
Feb 26, 2022, 3:55:22 PM2/26/22
to Joomla! General Development
Hello,

I am new to the Joomla platform and I would like to use the API only. I'm not interested in the installation of the CMS as such for a website however. Can those of you who have developed using the API kindly share your experiences.

I need to know how easy it is to access extensions and modules/components through the API and even if that's at all possible and what isn't possible; limitations encountered.

Is the API also configured for statelessness (no session data) and has anyone developed using the Joomla API with the Laravel framework.

I would be very grateful for all helpful information provided.

Peter Tuson

unread,
May 12, 2022, 1:53:55 PM5/12/22
to Joomla! General Development
Hello the Hobbit,

I developed an API for the component we developed for Joomla 3 and then updated it for Joomla 4.

We use the API to support the iShine app on both Android and iPhone. Our Joomla component (www.eluceo.org) has the same application although it is presented differently, so the component acts as the core database and processing for the app information.

The key is that when user registers on the mobile phone this is sent to the Joomla component for processing. If accepted, their username and password are encrypted and sent back for storage on the phone such that when the user runs the app again it automatically logs them in, keeping the session wherever possible. Unfortunately, in my opinion the Joomla 4 API is that is not yet suitable for integration with our mobile app so I worked out how to do it using my own approach. The mobile phone then requests the information it requires, information is pre-processed so it is easy for the mobile phone to process.

Having the application both on mobile and the component means that it is fairly straightforward to address user problems.

I hope that helps.

Regards,

Peter.

MarkRS

unread,
May 13, 2022, 12:04:25 PM5/13/22
to Joomla! General Development
Hi @Peter, what about the J4 API makes it unsuitable for integration with a mobile app?

Mark
(Looking at migrate J3 API mobile i/f to J4)

Peter Tuson

unread,
May 13, 2022, 1:31:13 PM5/13/22
to Joomla! General Development
To make it work, I have to put my login details on every phone using it, albeit encrypted.

However, the phone is owned by a registered user that has their own login details, which is important. This gives them access to their information.

Also the Joomla API seems to focus on lists and items, i.e. objects displayed on the web.

However to enable the phone app to work it needs quite of lot of data that doesn't fall into those categories. This data is processed using helper files on the web application.

Also, I have a method of validating the information returned to the phone after a request.

I hope this makes sense.

Regards,

Peter.

MarkRS

unread,
May 13, 2022, 2:57:52 PM5/13/22
to Joomla! General Development
Yup, I understand.

Well, you can do all of that, in varying degrees.

The "focus on lists and items" and information validation is easy.  The api "component" works just like the other two (site and admin).  You can show whatever you want.  Put model and controller stuff in your api section and do processing there just like you would if it were an admin or site form.  If you *don't* have a model section then it defaults to the admin models.  You may well want to override the display method in your JsonapiView class, otherwise your stuck with a "links, data, metadata" format of json output.

I saw a video (of George WIlson) talking about the access thing.  Before what he said, when you set up your api paths (errr, how are you making it work without the plugin??? That's intriguing to me) in the plugin, there's a fourth parameter to "createCRUDRoutes" that I'm guessing allows access *without* any certification.  However, to return to George, he said that application validation is probably best done with oAuth.  I'm afraid I've heard of that but don't know much more.  Might be an option?

As for personal login details, I'm expecting to do that in a POST call just the same as I used to, but I haven't got that far yet so I can't be certain.  I can't imagine those values will be unavailable.  It's (one of) the next things on my list.
Reply all
Reply to author
Forward
0 new messages