4

You can download the full API collection here: https://github.com/alexandreelise/j4x-api-collection thanks to Alexandre Elise. This will import directly into Postman which will enable you to use the API simply by adding your key and URL to the collection. To create a key you need to: Make sure the plugins are enabled. Make sure your user has a token Hit ...


2

You need to use your own custom JS for this. Here is an example for your given XML. (function($) { var catFieldName = 'fieldCat'; var itemFieldName = 'fieldItem'; var showHideFieldOptions = function() { var selectedCategory = $('select[name="jform[params][' + catFieldName + ']"]').val(), $itemField = $('select[...


2

If you are using Joomla 4 you can do it via WebAsset Manager, too: https://docs.joomla.org/J4.x:Web_Assets JQuery is shipped with Joomla 4. You do not need to add the library yourself; https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4#jQuery


1

You should include a user token with a bearer authentication header. You can get the token from your super admin account (Joomla API Token tab), given that the relevant plugin (User - Joomla API Token) is enabled. For the shake of simplicity you can try a curl tool like postman where all the headers can be added from a GUI. Also as mentioned by Sharky the ...


1

If you want to use a plugin then you should replace the echo/script you have with code that adds it to the header using the examples here, https://docs.joomla.org/Adding_JavaScript Or use a 3rd party plugin like Sourcerer from regular labs to do it for you, https://regularlabs.com/sourcerer


1

Use this: $this->input->files->get('file', [], 'array'); Note that returned data is formatted differently to allow iterating over files: array(2) { [0]=> array(5) { ["name"]=> string(16) "joomla_black.png" ["type"]=> string(9) "image/png" ["tmp_name"]=> string(...


1

First of all, please note that JResponse::appendBody() is a depreciated method. If you still want to use it, you can call it in a system plugin against the onAfterRender event. Here is an example - <?php defined('_JEXEC') or die; class PlgSystemMyPlugin extends JPlugin { /** * Application object. * * @var JApplicationCms */ ...


1

The problem was that techjoomla's api package had it's own functions for ACL that were designed to work with mobile phone apps. These introduced their own logic for determining whether a user was logged in. To solve the issue I simply commented out the functionality (and deleted the relevant files to save some disk space). Below is an excerpt from my edited ...


1

Even though you have found a solution to your issue I thought you might still like to understand what I think is going on. 'Remember Me' doesn't keep a user logged in as you might think, it actually stores a Cookie in the browser and when the user returns to your website the Cookie is checked and it will then log the user on without prompting them for a ...


1

As I suggested in my comment, building a plugin for this may be an alternative solution worth pursuing. In a system plugin, simply add code similar to the example below to intercept any calls. Rest assured the code below was not tested on animals. intercept onAfterRoute() ensure your code should really run there, as an example: exclude administrator ...


1

See the docs for controller task - Model View Controller. Since you want to make it accessible to registered users and not to the public, you can simply check the user and return if your checks do not pass. You can see the getUser method documentation here - Accessing Current User Object


1

Joomla 3 There are a few existing places to get an API for Joomla! 3. https://techjoomla.com/rest-api-for-joomla https://www.selfget.com/products/jbackend.html Joomla 4 Or in Joomla! 4 is a full API https://www.joomdev.com/blog/entry/joomla-4-api-introduction https://docs.joomla.org/Joomla_Api_Specification https://magazine.joomla.org/all-issues/august-...


1

Why not use this? basename(JPATH_COMPONENT);


Only top voted, non community-wiki answers of a minimum length are eligible