This plan helps you create custom API endpoints/REST APIs with which apart from just fetching data you can POST, PUT, DELETE (Insert, Update, Delete) data as well. Also, it provides an option to protect your custom APIs from unauthorized access. This plugin can also be used for Create, Read, Update and Delete WordPress content from client-side JavaScript or from external applications, even those written in languages beyond PHP.
Usecase: Connecting Mobile Application or External Website / External Portal with main WordPress website.
- Consider you have a main wordpress website and all your content, users information and several other details are stored in your main wordpress website itself. Now to extend the service , Mobile Application or Another website which is in
some different technology stack like Java, PHP, NodeJS, .Net ,etc is introduced in the architecture. In this case you can access all the data , content from your main website inside the Mobile Application and external website within
a few minutes. Our Custom API for WP Plugin helps you create unlimited custom APIs to fetch , insert , delete or update the data and these APIs can be directly used in the Mobile Application or External Website . You can have the data
incoming and outgoing in other platforms within just a few minutes.
Steps to Create Custom REST API
Step 1: Creating custom API for fetch operation
- Click on Create API in the navigation bar of the plugin for creating new APIs. After that enter the name of the API endpoint and choose the HTTP method as GET . After that select the table and select the column you want to fetch. Choose
appropriate conditions according to your requirements or you can opt for no condition as well. At last if you want to order your data, select the ORDERBY filter.
- Click on Add condition in case you want to apply multiple WHERE conditions to filter out the data and Select parameter as second parameter , that indicates in which field of URL parameters you’ll be entering condition values. You can
remove the condition as well by clicking the remove button. After configuring the API , click on Generate API at last to create your Custom endpoint/ REST API.
- After you click on generate API , you’ll obtain your Custom API/endpoint as mentioned below.Use this API on any platform according to your requirements.
- You will receive an API response in JSON format as shown below. For retrieving post with title “sample” , you can use following API http://localhost/wptest/wp-json/mo/v1/demo/sample where HTTP method will be GET.
Step 2: Editing existing Custom APIs/ REST APIs
- Click on the edit button in the front of the Custom API you want to edit.
- Configure the API as per your requirements and then click on Generate API .
- After you click on generate API , you’ll obtain your Custom API/endpoint as mentioned below.Use this API on any platform according to your requirements.
Step 3: Creating Custom API for PUT, POST, DELETE operation