Search Results :

×

Joomla Custom API Plugin

A Custom API plugin that lets you create custom APIs to expand the capabilities of the Joomla CMS (Content Management System). By using these APIs you can expose particular features or data from your Joomla website, allowing external programs or services to communicate with your Joomla website. With the help of the custom endpoints you have developed, this plugin offers a smooth method to work with the Joomla database, enabling you to easily carry out CRUD (Create, Read, Update, and Delete) operations.


  • Download the zip file for the miniOrange Custom API plugin for Joomla from the link here.
  • Login into your Joomla site’s Administrator console.
  • From left toggle menu, click on System, then under Install section click on Extensions.
Downlaod and Intall Custom API plugin
  • Here click on Browse for file button to locate and install the plugin file downloaded earlier.
Install the Custom API Plugin from your computer
  • Once Installation of plugin is successful. Now click on Start Using miniOrange Custom API plugin.
Start Using miniOrange Custom API plugin

    Why GET API

  • If you want to retrieve data or information from your Joomla site, then you can create a GET API. You can add multiple filters, conditions to the get API using our plugin.
  • When you make a GET request to an API, you can provide parameters or query strings in the URL to specify the data you want to retrieve from your Joomla site. The Joomla Custom API plugin then processes the request and returns the requested data in the response.

Configuration to create Custom GET API

  • Navigate to Joomla Create Custom APIs tab and click on click here button.
Custom API for Joomla - Create Custom APIs
  • Now enter the API name you want to provide to the API. Please confirm that you haven’t added any space in the name of API.
  • Then select the GET method from the dropdown.
  • Now select the table name on which you want to perform the data retrieve action.
Joomla Custom GET method
  • It will now show multiple options to select columns and filters for this API. Please specify the columns of the table from which you would like to retrieve data from the Joomla site. You can select the multiple columns here.
  • Choose appropriate conditions according to your requirements or you can opt for no condition as well. Click on + button if you want to add multiple WHERE conditions to filter out the data. You can remove the condition as well by clicking the - button.
  • At last if you want to order your data, select the ORDERBY filter.
  • After configuring the API , click on Save button at last to create your Custom endpoint / REST API.
Custom API Plugin

How to use Created GET API

  • Once you click the Save button, you will receive your Custom API/endpoint. You can utilize this API on any platform based on your specific requirements.
Custom API for Joomla -How to create get API
  • You need to pass parameters present in the Request format table in the form of query parameters of your request.
  • To retrieve the data of users of above example you need to follow the following:
  • Enter the URL ‘http://localhost/joomla_4.3.1/api/index.php/v1/mini/custom_get’.
  • Then select the GET HTTP method.
  • Pass id as a query parameter.
  • You will receive an API response in JSON format as shown below.
Custom API Plugin

    Why POST API

  • If you want to send data to your Joomla site to create resources on the site, then you can use the POST API.
  • When you make a POST request to an API, you send data in the body of the request, typically in JSON or form-encoded format. The Joomla Custom API plugin then processes the data and performs the necessary actions based on the information provided in the request.

Configuration to create Custom POST API

  • Navigate to Joomla Create Custom APIs tab and click on click here button.
  • Now enter the API name you want to provide to the API. Please confirm that you haven’t added any space in the name of API.
  • Then select the POST method from the dropdown.
  • Now select the table name on which you want to enter new data. Then Click on Save button.
Custom Rest API for Joomla- Custom API POST method
  • Then select the columns for which you are providing the data to add entry in the table.
  • Now you can select the data format in which you want to send the data to the header.
Joomla Custom GET method
  • After configuring the API , click on Save button at last to create your Custom endpoint/REST API.

How to use Created POST API

  • Once you click the Save button, you will receive your Custom API/endpoint. You can utilize this API on any platform based on your specific requirements.
Custom API for Joomla - Custom Endpoint for Joomla
  • To provide data for the columns mentioned in the "Request format" table, you should include the necessary values in the body of your request.
  • Please ensure that the body data format matches the format specified in the "Body data format" section.
  • To add entry to usergroup table of above example you need to follow the following:
  • Enter the URL ‘http://localhost/joomla_4.3.1/api/index.php/v1/mini/custom_post’.
  • Then select the POST HTTP method.
  • Pass data for id, parent_id ,lft ,rgt, title in the body of the request.
  • You will receive 1 in the response if data successfully entered in the table.
Custom API Plugin

    Why PUT API

  • If you want to update or replace an existing resource on your Joomla site, then you can create a PUT API.
  • When you make a PUT request to an API, you send data in parameters or query strings or in the body of the request to replace the entire representation of the resource identified by the request URL. The Joomla Custom API plugin then processes the data and updates the resource accordingly.

Configuration to create Custom PUT API

  • Navigate to Joomla Create Custom APIs tab and click on click here button.
  • Now enter the API name you want to provide to the API. Please confirm that you haven’t added any space in the name of API.
  • Then select the method PUT from the dropdown.
  • Now select the table name on which you want to enter new data.
Custom Rest API for Joomla - Custom API method PUT
  • Then select the columns for which you want to update using the API call.
  • Choose appropriate conditions according to your requirements or you can opt for no condition as well. Click on + button if you want to add multiple WHERE conditions to filter out the data. You can remove the condition as well by clicking the - button.
Custom Endpoint for Joomla- Custom PUT API
  • After configuring the API , click on Save button at last to create your Custom endpoint/REST API.

How to use PUT API

  • Once you click the Save button, you will receive your Custom API/endpoint. You can utilize this API on any platform based on your specific requirements.
Custom Rest API for Joomla -Custom PUT API
  • You have the flexibility to pass the data either as query parameters or within the body of the request.
  • Ensure that you pass the data using the format key=Parameter Name(mentioned in Request Format and Conditions Applied table) and value=according to the specific requirements.
  • To update user entry of above example you need to follow the following:
  • Enter the URL ‘http://localhost/joomla_4.3.1/api/index.php/v1/mini/custom_put’.
  • Then select the PUT HTTP method.
  • Pass data for name, username, param_1,param_2 in the body of the request(You can pass in the query format also).
  • You will receive 1 in the response if data successfully updated in the table.
Custom API for Joomla - Custom API successful Updated

    Why DELETE API

  • If you want to delete a specific resource on your Joomla site, then you can create a DELETE API.
  • When you make a DELETE request to an API, you can provide parameters or query strings in the URL or in the body of the request to specify the data you want to delete from your Joomla site. The Joomla Custom API plugin then processes the data and updates the resource accordingly.

Configuration to create Custom DELETE API

  • Navigate to Joomla Create Custom APIs tab and click on click here button.
  • Now enter the API name you want to provide to the API. Please confirm that you haven’t added any space in the name of API.
  • Then select the method DELETE from the dropdown.
  • Now select the table name of which you want to delete the data.
Custom API for Joomla - DELETE APIs
  • Choose appropriate conditions according to your requirements or you can opt for no condition as well. Click on + button if you want to add multiple WHERE conditions to filter out the data. You can remove the condition as well by clicking the - button.
Joomla Custom GET method
  • After configuring the API , click on Save button at last to create your Custom endpoint/REST API.

How to use DELETE API

  • Once you click the Save button, you will receive your Custom API/endpoint. You can utilize this API on any platform based on your specific requirements.
Joomla Custom Delete API-Custom API endpoints
  • You have the flexibility to pass the data either as query parameters or within the body of the request.
  • Ensure that you pass the data using the format key=Parameter Name(mentioned in Request Format and Conditions Applied table) and value=according to the specific requirements.
  • To delete user entry of above example you need to follow the following:
  • Enter the URL ‘http://localhost/joomla_4.3.1/api/index.php/v1/mini/custom_delete’.
  • Then select the DELETE HTTP method.
  • Pass data for param_1 in the body of the request(You can pass in the query format also).
  • You will receive 1 in the response if data successfully deleted in the table.
Custom API Plugin

Configuration to create Custom SQL GET API

  • 1. Navigate to Joomla Create SQL APIs tab and click on click here button.
Custom API for Joomla - Craete SQL GET
  • Now enter the API name you want to provide to the API. Please confirm that you haven’t added any space in the name of API.
  • Then select the method GET from the dropdown.
  • Note: You can also enable custom query parameters if you want to send a custom parameter in the API request
  • Write the Custom SQL Query that you want to execute on the successful API call.
Joomla Custom GET method
  • Note: To send custom parameters, you can write the query like the following: SELECT * FROM #__users WHERE id='{{id_param}}' AND email='{{email_param}}'; having _ is mandatory in the parameter name.
  • Click on Save button at last to create your Custom endpoint / REST API.

How to use Created SQL GET API

  • Once you click the Save button, you will receive your Custom API/endpoint. You can utilize this API on any platform based on your specific requirements.
Custom API for Joomla - Created SQL GET APIs
  • To retrieve the data of users of above example you need to follow the following:
  • Enter the URL ‘http://localhost/joomla_4.3.1/api/index.php/v1/mini/sql_get’.
  • Then select the GET HTTP method.
  • Pass id, email as a query parameter.
  • You will receive an API response in JSON format as shown below.
Custom API for Joomla - URL

Configuration to create Custom SQL POST API

  • Navigate to Joomla Create SQL APIs tab and click on click here button.
  • Now enter the API name you want to provide to the API. Please confirm that you haven’t added any space in the name of API.
  • Then select the method POST from the dropdown.
  • Note: You can also enable custom query parameters if you want to send a custom parameter in the API request.
  • Write the Custom SQL Query that you want to execute on the successful API call.
Joomla create Custom SQL Post- sql query
  • Note: To send custom parameters, you can write the query like the following: INSERT INTO #__users (id, name, username, email, registerDate, params) VALUES '{{id}}','{{name}}','{{username}}','{{email}}','{{registerDate}}','{{params}}';
  • Click on Save button at last to create your Custom endpoint / REST API.

How to use Created SQL POST API

  • Once you click the Save button, you will receive your Custom API/endpoint. You can utilize this API on any platform based on your specific requirements.
Setup Custom SQL post
  • To retrieve the data of users of above example you need to follow the following:
  • Enter the URL ‘http://localhost/joomla_4.3.1/api/index.php/v1/mini/sql_post’.
  • Then select the POST HTTP method.
  • Pass id, name, username, email, registerDate, params in the body of request.
  • You will receive 1 in the response if data successfully entered in the table.
Created Custom SQL POST API

Configuration to create Custom SQL PUT API

  • Navigate to Joomla Create SQL APIs tab and click on click here button.
  • Now enter the API name you want to provide to the API. Please confirm that you haven’t added any space in the name of API.
  • Then select the method PUT from the dropdown.
  • Note: You can also enable custom query parameters if you want to send a custom parameter in the API request.
  • Write the Custom SQL Query that you want to execute on the successful API call.
Custom API for Joomla- create custom APIs
  • Note: To send custom parameters, you can write the query like the following: UPDATE #__users set username='{{username}}' where id='{{id}}';
  • On Save button at last to create your Custom endpoint / REST API.

How to use Created SQL PUT API

  • Once you click the Save button, you will receive your Custom API/endpoint. You can utilize this API on any platform based on your specific requirements.
Custom Rest API for Joomla -Custom PUT API
  • To update the data of users of above example you need to follow the following:
  • Enter the URL ‘http://localhost/joomla_4.3.1/api/index.php/v1/mini/sql_put’.
  • Then select the PUT HTTP method.
  • Pass username, id in the body of request or in the query parameter.
  • You will receive 1 in the response if data successfully entered in the table.
Custom API for Joomla- data successfully

Configuration to create Custom SQL DELETE API

  • Navigate to Joomla Create SQL APIs tab and click on click here button.
  • Now enter the API name you want to provide to the API. Please confirm that you haven’t added any space in the name of API.
  • Then select the method DELETE from the dropdown.
  • Note: You can also enable custom query parameters if you want to send a custom parameter in the API request.
  • Write the Custom SQL Query that you want to execute on the successful API call.
Custom API for Joomla- DELETE SQL
  • Note: To send custom parameters, you can write the query like the following: DELETE FROM #__users WHERE id='{{id}}';
  • Click on Save button at last to create your Custom endpoint / REST API.

How to use Created SQL DELETE API

  • Once you click the Save button, you will receive your Custom API/endpoint. You can utilize this API on any platform based on your specific requirements.
Joomla Custom Delete API-Custom API endpoints
  • To delete the data of users of above example you need to follow the following:
  • Enter the URL ‘http://localhost/joomla_4.3.1/api/index.php/v1/mini/sql_delete’.
  • Then select the DELETE HTTP method.
  • Pass id in the body of request or in the query parameter.
  • You will receive 1 in the response if data successfully entered in the table.
Custom API Plugin
  • Click on the edit button in the front of the Custom API you want to edit.
Custom API for Joomla-existing APIs
  • Update the API as per your requirements and then click on Save. Then use the updated API according to your requirement.
  • Click on Add Authentication tab in the navigation bar of the plugin.
  • Enable the button if you want to add Token based Authentication to your custom APIs.
  • You can choose the HTTP methods for which you want to add an authentication method.
  • Then click on the Save button.
Custom API for Joomla-Add Authentication

How to protect Joomla Custom REST APIs?

  • You can protect your Custom REST APIs with API Key, JWT (JSON Web Token),Basic Authentication, and Bearer Token. These options allow you to control and secure access to your API, ensuring that only authorized users or systems can interact with your data and services.

Authentication methods for Rest APIs:

Custom API for Joomla-Add Authentication

Bearer token

  • Bearer Token is a secure and widely used authentication mechanism where the user accesses the Custom REST APIs by providing a pre-generated token. To use any API with this method, you must send a request with the token included in the Authorization header using the Bearer scheme.

Here’s how to use Custom REST API Authentication using Bearer Token:

  • Select Bearer Token from the authentication method dropdown.
  • Generate the Token.
  • Copy the Token.
Custom API for Joomla-Add Authentication

Testing in Postman:

  • Select the API endpoint.
  • Go to the Authorization tab → select Bearer Token.
  • Paste the token and click Send.

Basic Auth

  • Basic authentication is a simple authentication mechanism where the user can use their credentials to protect the Custom REST APIs. In order to use any API with this method of authentication, you need to send a request with your base64 encoded username and password in the Authorization header.

Here’s how to use Custom REST API Authentication using Basic Auth:

  • From the dropdown in the method selection, choose Basic Auth.
  • Provide the Username and Password, then click Save.
  • All selected APIs will now use Basic Authentication. Requests will include required headers and body parameters.
  • The combination of username:password must be Base64-encoded in the Authorization header.
Custom API for Joomla-Add Authentication

Testing in Postman

  • Open Postman and enter your API endpoint.
  • Go to the Authorization tab and select Basic Auth.
  • Enter your username and password.
  • Click Send.
  • The request will be authenticated using Basic Auth, and you will see the response based on valid credentials.

JWT authentication

  • JWT authentication allows you to authenticate the Custom REST API and Joomla default API endpoint access using a valid JWT token (JSON Web Token). The plugin provides an endpoint to generate a Bearer JWT using the valid user’s Joomla login credentials. The generated token can be used to authenticate the Custom and Joomla REST API endpoints.

Here’s how to use Custom REST API Authentication using JWT Authentication:

  • Select JWT Auth from the method dropdown.
Custom API for Joomla-Add Authentication

Depending on the algorithm:

  • For HS256, enter the Secret Key.
  • For RS256, upload the Public & Private Keys.
Custom API for Joomla-Add Authentication Custom API for Joomla-Add Authentication
  • Enter the expiry time (e.g 3600 for 1 hour).
Custom API for Joomla-Add Authentication
  • Click on the Save button.

To get the JWT Token, follow the following steps:

  • To acquire the JWT, we must submit a POST query that contains the user’s Joomla credentials. The Username and Password must be sent in a base64-encoded format. For your convenience, please refer to the format of the request below.

                 Request: POST <your_joomla_base_url>/api/index.php/v1/mini/id_token
                 Header: 
                        Authorization: Basic base64encoded <username:password;>
                        Accept: application/json
                 Sample curl Request Format-
                 --location --request POST "<your_joomla_base_url>/api/index.php/v1/mini/id_token' \"
                 --header 'Accept: application/json'\
                 --header 'Content-Type: application/json' \
                 --header 'Authorization: Basic base64encoded’ \'
             
  • You can also refer to the image of the Postman request to get the JWT from joomla.
Custom API for Joomla-Add Authentication
  • A successful response returns the JWT along with its token expiry. (Please refer to the image below.)
Custom API for Joomla-Add Authentication
  • To perform authentication using JWT, simply add the received JWT as a Bearer token in the Authorization Header.
Custom API for Joomla-Add Authentication

API key authentication.

  • API Key Authentication allows you to authenticate the Custom REST API endpoint access using an API key authentication. This method eliminates the need for using the user’s Joomla login credentials for generating the API key (secret token).

Here’s how to use Custom REST API Authentication using API Key:

  • Select API Key from the method dropdown.
  • Enter the Key Name (e.g., x-api-key, token, etc.) and the Key Value (e.g., 123abcXYZ).
  • Choose how it should be sent – in the Header or Query Parameter.
  • Click on Save
Custom API for Joomla-Add Authentication

Testing in Postman:

  • Go to the Headers or Params tab.
  • Add the key-value pair as configured.
  • Click Send to test.

Configure External APIs with different Methods

  • Navigate to the External APIs tab and click on Configure External API button.
  • Enter the API Name you want to give to the API connection. This API name should be unique as it will be used to connect it with Joomla.
  • Select the method according to your external API from the Select Method dropdown which you want to connect to the Joomla site.
Custom API for Joomla - External APIs
  • You can pass query parameters which are necessary for this configured API. For the data to be sent in the query parameters format:
  • There are 2 text fields - first is to enter the key and second one is to enter the value.
  • For example→ If you have to pass the following query parameter ‘username→testuser’ then you need to put the ‘username’ in the key and ’testuser’ in the valuE field.
  • You can add multiple parameters using + button.
  • In the Headers, there are 2 text boxes - the left one is for the header name and the right one if for the header value that needs to be passed. For example : If the header passed to be in the format Authorization:Bearer then the ‘Authorization’ will be added in the first textbox and ‘Bearer should be put in the right textbox as shown in the diagram below.
Custom API for Joomla - multipal parameters
  • If the API provider expects the data needs to be sent in the body of the API endpoints request, then you can fill in the required details. There are 2 formats available in which you can send the data : x-www-form-urlencoded and JSON.
  • For the data to be sent in the body parameters in x-www-form-urlencoded format:
  • There are 2 text fields - first is to enter the key and second one is to enter the value.
  • For example→ If you have to pass the following body parameter ‘username→testuser’ then you need to put the ‘username’ in the key and ’testuser’ in the value field.
  • For the multiple key value pairs that need to be passed in the request body of the API endpoint request, you can click on the + button.
  • For the data to be sent in the body parameters in JSON format: You need to select the JSON from the dropdown corresponding to the Request Body
Custom API for Joomla - JSON Format
  • Now click on the Save button.
  • Then click on Test Configuration To test the API connection and fetch the response. You will receive the Attributes Table as shown below.
Setup Custom API for Joomla

Short Codes for External APIs

  • After configuring the external API you will receive short code for a particular API.
Setup Custom API for Joomla- Short Codes for External APIs
  • You can use this shortcode in Joomla articles to show the data to your Article.

If you want Business Trial for FREE Click Here

If you don't find what you are looking for, please contact us at joomlasupport@xecurify.com or call us at +1 978 658 9387.

ADFS_sso ×
Hello there!

Need Help? We are right here!

support