Questions tagged [joomla-api]
This tag is for questions related to the Joomla-API, both Joomla CMS and Joomla Framework.
228
questions
0
votes
1
answer
21
views
Plugin/Module Development - How to stop all further processing?
So, I want to write a plugin/module that, when certain requirements are met, the plugin stops all further processing and returns a blank page.
For my needs, the use case for this can be one of two ...
1
vote
0
answers
31
views
Not able to connect to Joomla core APIs in Joomla 4.x upgraded from Joomla 3.x
We had recently upgraded our Joomla site from 3.x to 4.x. We now have a requirement to connect to Joomla core APIs. But we are not able to do so. It is giving error: Unable to load router: api .../...
0
votes
1
answer
202
views
implode(): Argument #1 ($array) must be of type array, string given
On a site for certain articles (and not others!!)
I have the following error message *
This worked in j3/php7.4. Perhaps a problem comes from switching to j5 / php8.1
What's strange is that it works ...
0
votes
1
answer
28
views
How to integrate Nicepage site on Joomla
I am kinda new to this whole website thing. Definatly dont have much experiance in coding ect, but I have created a whole website with a nicepage paid subscription. I downloaded Joomla and XAMPP. I ...
0
votes
0
answers
25
views
Problem setting image info when creating an article via the J4 REST API
I’ve been using the J4 REST API for a while to create articles from form data through the Webhook feature of the Convert Forms extension. It works great for both standard article fields and for ...
1
vote
2
answers
66
views
Component middleware for handling URLs
I have a component com_something that I am developing. Whenever a user goes to any view in this component (i.e. when the URL starts with index.php?option=com_something), I want to check the URL for a ...
1
vote
1
answer
74
views
API access without accept header
So this issue has already been noticed here:
https://github.com/joomla/joomla-cms/issues/39332
My component gets accessed via the API by a big company who is using the same access with hundreds of ...
0
votes
1
answer
52
views
API Token alternative for inside request header
So the X-Joomla-Token with the API Key is added to the Request Header upon starting a request.
I have a partner that needs to access the API but is due to his infrastructure not able to add the Token ...
0
votes
1
answer
57
views
Show the category custom fields in article page
I have category custom fields and I need to show these in the article (which is in the category) view.
I have used the following:
use Joomla\CMS\Factory;
use Joomla\Component\Fields\Administrator\...
0
votes
1
answer
80
views
API Routes with more than one parameter in Joomla 4/5
I have an API route that should accept more than one parameter, but it seems that only one parameter is being recognised, like this:
new Route(
['POST'],
'v1/myapiendpoint/:nr/:id',
'mycomponent....
1
vote
1
answer
42
views
Grant access to Joomla API from just one site
In Joomla Joomla 4/5:
What is the best strategy to allow access to Joomla API endpoints from only one (or more) specific domains?
And how is this configured in Joomla 4/5? (CORS vs. HTTP-Header-Plugin ...
0
votes
0
answers
27
views
How to handle duplicate items coming from an external JSON API and being imported as article content
I have adapted working code from Joomla 3 and the CLI to Joomla 4/5 and the API. The core functionality using the API system is working, but I am struggling to find a replacement for checking for ...
2
votes
1
answer
230
views
File Upload from WebApp to Joomla API
I have successfully programmed a Joomla 4/5 API to generate an API web service. There is a kind of weird bug uploading files though, because it basically works on localhost - but on the live system I ...
0
votes
1
answer
100
views
Getting a Joomla 4 API component to work with language files
When programming a component for an API, the config contains the following language file definitions:
<api>
<files folder="api">
<folder>src</folder>
&...
0
votes
1
answer
61
views
OnContentPrepare not working in custom Joomla Plugin
I have made other plugins for Joomla 4 but I am still a novice. The past two days I have been searching for a solution, it's becoming quite frustrating. I have brought back my code in the php file to ...
0
votes
1
answer
75
views
J4 REST API Get users how to filter?
The J4 REST API allows me to GET a full list of users, but I have not found any example of how to filter such a request, for example by searching by userID or email.
When I look at the code for the ...
1
vote
0
answers
41
views
Updating user via J4 REST API resets password
In our organization we use Salesforce as the authoritative source of info about our users, so it makes sense for us to use that info when creating the associated users in our new Joomla site.
I have ...
2
votes
2
answers
546
views
How to authenticate a user with the official Joomla 4 REST API?
I am developing a mobile app that needs to authenticate users with a Joomla 4 site. I want to use the official Joomla REST API to do this, but I couldn’t find any information about how to authenticate ...
3
votes
1
answer
170
views
Filling custom fields when creating an article with an script via the API
I am creating an article in Joomla 4 using the excellent code that is suggested here: Joomla 4 create article programmatically
My task is write the values of the custom field simultaneously with the ...
0
votes
1
answer
87
views
Jinput getAray not retrieving RAW details from codemirror editor in Joomla 4
I am busy with a project to convert an Joomla 3 template to Joomla 4. The Jinput is not giving me RAW data it is removing the script tags from my inputs. I worked through a couple of similar problems ...
0
votes
1
answer
34
views
J4 API Test Helper missing functions
So I installed codeception/module-rest and created an api.suite.yml containing:
modules:
enabled:
- Helper\JoomlaDb
- Helper\Api
config:
Helper\JoomlaDb:
dsn: "mysql:host=...
0
votes
2
answers
305
views
Help with update a JoomlaCli-Application from Joomla 3 to Joomla 4
I'm working with a JoomlaCli Application, called from a external php command via a cronjob. It worked in Joomla 3, but in Joomla 4 some classes have changed.
Our class name is import
Namespaces:
use ...
1
vote
0
answers
42
views
Joomla 4 API rename attributes
In Laravel, you can use eloquent mutator transforms to change field names (database table column name) to a preferred/alias property name. How can this be done in Joomla 4?
I know I could do this in ...
1
vote
2
answers
113
views
Joomla 4 API MVC Layer type
Is it possible to create a webservice and API access for my own component if the component file structure is not setup like this and uses namespace based classes?
https://docs.joomla.org/J4.x:...
1
vote
1
answer
270
views
Webservices returns The requested URL was not found on this server with a 404
When using Webservices on my local development environment, but the problem is not unique to local environments, I received the following message for even the core features,
The requested URL was not ...
2
votes
1
answer
135
views
How to initialize joomla modal through js
I'm customizing a view in my component, I have tabs, each tab contains a modal, but when adding a new tab using js, I don't know how to initialize the new tab's modal via js?
4
votes
0
answers
939
views
(4.1 -> 4.2) Attempted to load class TemplateComponent from namespace Joomla\Component\Administrator\Extension calling $app->getTemplate
I have a file test.php that manually loads the Joomla framework and prints template parameters.
<?php
// test.php, located in the same directory that index.php is
define('_JEXEC', 1);
define('...
2
votes
2
answers
226
views
Can we get the featured articles in a GET call through Joomla 4 API?
For now we have api/v1/content/articles, but this gets ALL the articles from the site. I do not need the whole list, just the featured articles.
Will we need to create an api-component as a temporary ...
2
votes
2
answers
196
views
Identify Joomla 4 API access
If I do an API call like this:
curl --location --request GET "http://127.0.0.1:8000/api/index.php/v1/users" --header "X-Joomla-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
I get ...
1
vote
2
answers
156
views
Webservices Route
If I create Route for the API via
$router->createCRUDRoutes( 'v1/foos', 'foos', ['component' => 'com_foos'], true );
Like explainded in https://joomla.stackexchange.com/a/32322/7387 the Route ...
4
votes
2
answers
566
views
Joomla API and Credentials
I am taking my first steps in integrating the Joomla API. I used this tutorial: https://blog.astrid-guenther.de/en/joomla-webservices/
Now I am wondering if it is really necessary to include the ...
1
vote
0
answers
66
views
I can't get $params->set() to work to transfer variable from module to template
I'm trying to get a variable from my module to my template but its not working.
In my modules xml I defined:
<fields name="params">
<fieldset name="basic">
&...
4
votes
4
answers
1k
views
Joomla 4 API Question
How to convert a custom Joomla 3 to Joomla 4, and use the Joomla 4 web services API?
I have an extension I wrote for J3 and with a bit of tweaking it works just fine in J4. I want to add web services ...
1
vote
1
answer
70
views
Joomla 4 API Issues using Joomshaper Melvin Template
It may be too specific a question, but is anyone having any issues utilizing Joomla 4 Templates and the API with extensions from Joomshaper? I have 1 site that seems to work fine, but another that is ...
0
votes
1
answer
130
views
Displaying API data in Joomla Component
So, this is a two parted question but both pertaining to REST APIs. I am developing a component for Joomla in which I have a few database fields (ie. teamid and platform) that are stored in the local ...
3
votes
1
answer
142
views
Is showing a Joomla API token in JS a security risk?
I have created a couple of web services under Joomla 4 that are simple enough calls to the same website to refresh a couple of fields when something else changes. In my JS code I have the 'X-Joomla-...
1
vote
1
answer
158
views
cant display simple text onContentPrepare
I just want to display simple text and this is not working.
I don't know is there a way to see something like log to see what happens in the background?
public function onContentPrepare($context, &...
1
vote
0
answers
168
views
getting first image of article for open graph
I've been a PHP developer for long time, but I am new to Joomla.
On a Joomla 2.5 project, I need to make open graph meta tags. As a part of open graph meta tags, I need to find first image of article. ...
2
votes
2
answers
480
views
Integrate external news content API into com_content articles
My client is looking to integrate news content coming from an external API into their Joomla website. The API is in the JSON format and includes multiple fields like title, summary, date, and full ...
1
vote
1
answer
742
views
Joomla 4 - get module params in external php
In Joomla 3, I get module params with this code:
// Create the Application
$app = JFactory::getApplication('site');
$module = JModuleHelper::getModule('mod_dev');
$presetParams = new JRegistry($...
2
votes
1
answer
357
views
Are custom fields updatable using joomla 4 api?
Simply put when using the API to update a custom field of an article, the new information is not successfully passed through. Furthermore, the original contents are deleted from the field.
The ...
1
vote
1
answer
194
views
J4 API - There are two variables for Article Text, why do neither work on PATCH?
While working with the new Joomla 4 web services API. The Article text does not update. Additionally, as per the documentation, when creating an article via API the article text variable is ...
4
votes
2
answers
566
views
Is Joomla4 API/Web Service ready for production use?
I've read what little I can find about J4 Web Services, but cannot find a working example or get my code to work. The code below should work by all accounts, but I get forbidden on my local machine ...
1
vote
2
answers
197
views
How to create joomla plugin with jquery code
What is the best way how to add jquery code by Joomla plugin?
How can I set that these code should be applied just for checkout page of VirtueMart in xml file?
Is this the best way?
<?php
// no ...
0
votes
1
answer
180
views
Upload single or multiple files replacing deprecated JRequest::getVar('file', '', 'files', 'array');
I am trying to upload a single or array of files and am not sure how to use the jinput with the array and filter. Tried multiple suggestions from here and documentation and cannot make it work for me.
...
1
vote
1
answer
226
views
What is the correct way to use appendBody
I'm trying to understand appendBody
First of all append would seem like it comes after the </body> but I assume it can only mean after the contents of the body. And prepend before the contents ...
2
votes
1
answer
81
views
Reset list option-value when changing showon value
I am currently writing a module with many backend settings, some of these use the "showon" attribute.
For example: I have two fields of type "list". In the second one, the options ...
0
votes
0
answers
209
views
Adding Azuracast JSON file to my AM HTML5 AUDIO PRO PLAYER in joomla
I need help for a problem that i didn't found solution.
we have a web radio created with joomla and we start to put our programs 24h/24.
I bought an AM HTML5 AUDIO PRO PLAYER and everything work fine ...
3
votes
2
answers
120
views
What does it mean for a user to be 'logged in' to Joomla?
I am having an issue with the ACL of my Joomla API. I created this using the TechJoomla api component.
I have the following code to handle post requests on my api.
<?php
use Joomla\CMS\...
2
votes
2
answers
896
views
What is url for calling task in controller for Joomla 4?
This is my ajax query for calling a task in the controller (it works for Joomla 3 but doesn't work for Joomla 4):
$.ajax({
type: "POST",
url: "index.php?option=com_scrib&...