
- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
- Hits: 41
Do you use Joomla Framework or the Http package from the Joomla Framework when creating Joomla extensions? Here is something for you about what I called:
Insidious Request Morphing
Insidious what? Yep! you got it wait for it
Insidious Request Morphing:
When using a call to request with http package of joomla framework, if you don't want to send a request body you MUST set data argument to null!!!!
If you don't do this, somehow curl in php will transform your GET request to POST request which might have unexpected results.
Pulling my off for years!!!!
How to debug it:
Ref: https://stackoverflow.com/a/14436877/8309401
Side note:
Put this when initialising your curl transport options
For example:
$filename = Path::clean(Factory::getApplication()->get('tmp_path', sys_get_temp_dir()) . '/debug-curl.txt');
$filenameHandle = fopen($filename, 'w+');
$http = new \Joomla\Http\Transport\Curl([CURLOPT_VERBOSE => true,CURLOPT_STDERR => $filenameHandle,]);
// The revelant part is null when not sending a request body
// Other variables have not been set for brevity
$http->request('GET', $uri, null, $headers, $timeout, $userAgent);

- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
- Hits: 364
Today we are trying OMDb Movie Api. Mashing up Joomla! Web Services with OMDb The Open Movie Database Api
Fetch your favorite movies and turn them into a Joomla! article. Don't forget to delete the articles when you see the demo working as expected.
Our intention here is not to scrape the whole internet but to showcase what is possible with Joomla! Web Services mashup.
You can now do all that using a single self-contained php script in about 300loc.
Here is the screenshot of the result:
Read more: API EXAMPLE - Fetch Your Top 5 Favorite Movies with Joomla! 4.x Web Services...

- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
- Hits: 456
Today we are playing with GraphQL. Mashing up Joomla! Web Services with the power of Giants like the GitHub GraphQL API.
You can now do all that using a single self-contained php script in about 300loc.
Here is the screenshot of the result:
Read more: API EXAMPLE - Joomla! 4.x Web Services and GitHub GraphQL API

- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
- Hits: 461
Now you can use one line api to sync multiple articles from Airtable Api to multiple Joomla! sites at once with a single self-contained php script leveraging Joomla! Web Services.
Here is the screenshot of the result:
Read more: ANNOUNCEMENT - Now you can use one line api to sync multiple articles from...

- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
- Hits: 425
Here is the screenshot of the result:
Read more: ANNOUNCEMENT - Now you can use one line api to sync multiple articles from a...

- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
- Hits: 529
With this version of the Smart POST / PATCH php script, you can now:
- POST / PATCH Existing subform custom field using csv url
- POST / PATCH Images (intro image and fulltext image)
- POST / PATCH Urls (urla,urlb,urlc)
Here it is:
Read more: ANNOUNCEMENT - New Features Added Support For Subform Custom Fields To Smart...

- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
- Hits: 634
Today, it's about a major improvement of the samples, in particular POST and PATCH. It enhance the developer experience in about 200 lines of pure PHP.
Here it is:
Read more: ANNOUNCEMENT - Smart POST or PATCH Joomla! articles via API code example...

- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
- Hits: 340
If you are a Joomla! developer or want to become a Joomla! developer there is a new resource for you The Official New Joomla! Manual
If you are eager to learn more about Joomla! Web Services and want to play around with them using ready to use short examples, sample code and experiments this repo is for you. The examples are intentionally short with comments and for common scenarios and use cases. So even a non-developer could follow along.
If this code is useful to you, spread the Joomla! love and give it a star on GitHub: Star
- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
-
Also available:
- Hits: 2536
Example of basic Joomla! 4 component implementing webservices in Joomla! 4
Works with curl, Guzzle, Postman and other HTTP clients

- Details
- Written by: Mr Alexandre J-S William ELISÉ
- Category: Blog
-
Also available:
- Hits: 3137
System - Jiji
Jiji is a System Plugin leveraging the Joomla! 4 Web Services by adding custom actions to core Joomla! console without “hacks” using DI Container and other Joomla! 4 advanced capabilities.
Edit: After searching later on the web I found out that Chris Davenport already did something similar I think for Joomla 3 at that time. Joomla 4 didn't exists yet.
WHY ?
I started Jiji back in December 2020 because at that time I wanted some kind of proof of concept, a toy project to try out the new Joomla! 4 console which is based on Symfony Console. If you already know Symfony Console you will be at home with Joomla! 4 Console.
WHAT ?
“Jiji” name comes from what I thought might be a “cute girl” name based on a short nickname version of our beloved “Joomla!” which is a trademark of Open Source Matters by the way.
HOW ?
Jiji is a System Plugin which “adds” or “registers” new commands to the default joomla console cli script JPATH_ROOT/cli/joomla.php
I could create my own console script for that named JPATH_ROOT/cli/jiji.php but I thought it might be better to have only one entrypoint for joomla cli which make it easier to remember. You will tell me if I am wrong. Willing to hear your feedback on that.
The “Jiji” code is in a Library placed in the src directory inside the plugin.
it is namespaced as AE\Library\Jiji . Namespace are available since PHP 5.3
The Behavior directory holds all the PHP Traits used by the Plugin. Traits are available since PHP 5.4. Basically, they are common behaviors used in unrelated Php Classes. In other words, when you find yourself copy/pasting again and again a functionality from one Class to another, it might be a good candidate for a Trait.
The heart of this plugin is in the AE\Library\Jiji\Console namespace. Is the corresponding directory you will find my first Console Command named HelloSuperJoomlerCommand.php which just says “Hello Super Joomler”. But another directory more interesting is Article directory where are all Article related Commands.
- GET all articles (Browse)
- GET one article by id (Read)
- PATCH one article by id (Edit)
- POST one article by id (Add)
- DELETE one article by id (Delete)
In order to DELETE you must first do a PATCH with at minimum the category id , the title and the state as -2 of the article you want to DELETE.
Example JSON payload: ‘{“catid”:64, “title”:“My edited title”, “state”:-2}’
“Jiji” can use a JSON file or JSON string as payload for your requests containing a body.
INSTRUCTIONS:
1 - The extension zip is in the build/ directory of this GitHub repository
2 - Install the Jiji plugin as any other Joomla! 4 extension.
3 - Follow these instructions
JPATH_ROOT : the root directory of your Joomla 4 website. Change this with the relevant directory absolute path
J4X_BASE_PATH : Your Joomla! 4 Base Url (eg: https://example.com)
J4X_API_TOKEN : Your Joomla! 4 API Token
You can use it non-interactive by adding the -n
Execute the basic Command Hello Super Joomler
php JPATH_ROOT/cli/joomla.php jiji:hello
Execute the Browse Article Command
php JPATH_ROOT/cli/joomla.php -n --base-path=J4X_BASE_PATH --api-token=J4X_API_TOKEN article:browse
Execute the Read Article Command (eg: id=1)
php JPATH_ROOT/cli/joomla.php -n --base-path=J4X_BASE_PATH --api-token=J4X_API_TOKEN article:read --id=1
Execute the Add Article Command
using a JSON string as payload
php JPATH_ROOT/cli/joomla.php -n --base-path=J4X_BASE_PATH --api-token=J4X_API_TOKEN article:add --item-data='{"alias": "my-article","articletext": "My text","catid": 64,"language": "*","metadesc": "","metakey": "","title": "Here's an article"}'
or more conveniently using a JSON file as payload
php JPATH_ROOT/cli/joomla.php -n --base-path=J4X_BASE_PATH --api-token=J4X_API_TOKEN article:add --item-data='path/to/add-article.json'
Execute the Edit Article Command (eg: id=1)
using a JSON string as payload
php JPATH_ROOT/cli/joomla.php -n --base-path=J4X_BASE_PATH --api-token=J4X_API_TOKEN article:edit --id=1 --item-data='{"catid": 64,"title": "Here's an another article"}'
or more conveniently using a JSON file as payload
php JPATH_ROOT/cli/joomla.php -n --base-path=J4X_BASE_PATH --api-token=J4X_API_TOKEN article:edit --id=1 --item-data='path/to/edit-article.json'
Execute the Delete Article Command (eg: id=1)
This must be done in two steps due to this new way to do it
1 - Execute the Edit Article Command on the article you want to delete by change it’s state to -2 (Trash)
2 - Execute the Delete Article Command on the article you want to delete.
Step 1 for Deleting Article
using a JSON string as payload
php JPATH_ROOT/cli/joomla.php -n --base-path=J4X_BASE_PATH --api-token=J4X_API_TOKEN article:edit --id=1 --item-data='{"catid": 64,"title": "Here's an another article", "state": -2}'
or more conveniently using a JSON file as payload
php JPATH_ROOT/cli/joomla.php -n --base-path=J4X_BASE_PATH --api-token=J4X_API_TOKEN article:edit --id=1 --item-data='path/to/delete-step-1-article.json'
Step 2 Deleting Article
php JPATH_ROOT/cli/joomla.php -n --base-path=J4X_BASE_PATH --api-token=J4X_API_TOKEN article:delete --id=1
CONTRIBUTORS
Contributors are welcomed to jump in and help improve this project. Any constructive feedback is welcomed.
- I.R.M - Insidious Request Morphing
- API EXAMPLE - Fetch Your Top 5 Favorite Movies with Joomla! 4.x Web Services and OMDb Movie Api
- API EXAMPLE - Joomla! 4.x Web Services and GitHub GraphQL API
- ANNOUNCEMENT - Now you can use one line api to sync multiple articles from Airtable Api to multiple Joomla! sites at once
- ANNOUNCEMENT - Now you can use one line api to sync multiple articles from a csv url to multiple Joomla! sites at once