Joomla 4 web services project

Joomla 4 alpha version has been rolled out will many new improvements and features. Web services in Joomla 4 is another new improvement. The idea to add web services in Joomla is the benefits of it. Web Services are used in various projects commercial and government projects and news services. In this blog post, we will discuss the web services and its project for Joomla 4

Joomla 4 web services project

What are web services and why it used:

There are the different definition of the web services due to its name. The SOAP standards Were also called as the web services on the other hand they also called as the REST API. In Joomla sites, the web services are already in used. Many site owners used the API to sell their products on Joomla website. For example, a magazine website distributing its news and updates to other using API, In Joomla API is also used to build mobile applications to increase the traffic via promoting the articles.

Web Services Project in Joomla 4 :

API integration on Joomla website is a necessity for website owners to increase their businesses, Joomla 4 will have the capability to provide API for Joomla websites. As per Joomla summer of code, this project will be able to provide REST interface and this will become the first and only web application which will integrate with Joomla content management system extensions. The application will be part of the core Joomla framework.

Work Progress:

The project to add web services in Joomla 4 is under process and there is much work that has been already done. Below is the list of projects under web services :

API Application:

Joomla framework represent Application programming Interface to its application like any other framework. An application has the full responsibility to take request first, then get a specific routing for this so that routing request goes to the particular component to execute the logic of component. Each request has been taking place when it gets the request at the entry point of API.

This request further parsed and routed in applications. Here are some example of API request for the com_content

  • List Articles (/api/v1/articles)
  • Single Article (/api/articles/v1/999)
  • Retrieve an Article (GET request)
  • Create an Article (POST request)
  • Update an Article (POST request)
  • Delete an Article (DELETE request)

API Router:

Joomla is using router library for routing, In Joomla, each component has different functions, to send a request to correct component is used to make the system working.The process that figures out/send which request is sent or used by which system is routing. In application programming interface it uses API router so when it gets a new request an event has been triggered call as onBeforeApiRoute. At this point, the developers can start the plugin development that will catch this event to build routing. After this step application will use routing object to parse the URL.When component takes the routing event it can access to the router object that is passed to the routing event.

API Controller

API Controller used to handle the implementation of a basic CRUD for the component.

API Views

There are two views for the API ListView and Item view. The views are used for retrieving data and push them into the API document.

This blog post has been referenced by Joomla Goc web services project here.

For more information on Joomla 4 features and improvements please have a look at these blog posts:

Joomla 4 web services project 4.205 (84.00%) 5 votes
This article was first published January 12th, 2018