Generate Custom REST API endpoints into WordPress



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.

USE CASES:

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.
  • Custom REST API create API with GET, PUT, POST and DELETE method

Need Help?

Mail us on oauthsupport@xecurify.com for quick guidance(via email/meeting) on your requirement and our team will help you to select the best suitable solution/plan as per your requirement.

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.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • 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.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • 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.
  • Custom REST API create API with GET, PUT, POST and DELETE method

Step 2: Editing existing Custom APIs/ REST APIs

  • Click on the edit button in the front of the Custom API you want to edit.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • Configure the API as per your requirements and then click on Generate API .
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • 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.
  • Custom REST API create API with GET, PUT, POST and DELETE method

Step 3: Creating Custom API for PUT, POST, DELETE 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 PUT. After that select the table and select columns you want to update . Choose appropriate conditions according to your requirements and you can add multiple conditions as well by clicking on the Add Condition button on screen.
  • After configuring your API click on Generate API to create Custom API/endpoint.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • After clicking on generate API you’ll be redirected to the Home page of plugin where you can see the details of the Custom API you just created. Custom API can be used on any platform. For passing the information required by your API, you need to follow the format mentioned under Request Body and send the data via key:value pair in the body of your API request in form-urlencoded manner.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • Request on API via POSTMAN:
    Response of PUT Custom API call return number of columns that are updated.
  • Custom REST API create API with GET, PUT, POST and DELETE method

Restricting public access to Custom APIs:

  • Click on Add Authentication method in the navigation bar of the plugin. Now you can click on the “SHOW” button to check your API key and you can also generate a new key by clicking on “Generate new key”.
  • You can select HTTP methods which you want to restrict from public access from the check box options as shown below. After that click on save button.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • To access restricted APIs you need to pass your API KEY value in Authorization/Authorisation key in the form of key value pair in the header of your Custom API request.
    For eg- header{Authorisation: }
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • 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 POST. After that select the table and select columns in which you want to insert the data.
  • After configuring your API click on Generate API to create Custom API/endpoint.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • After clicking on generate API you’ll be redirected to the Home page of plugin where you can see the details of the Custom API you just created. Custom API can be used on any platform. For passing the information required by your API, you need to follow the format mentioned under Request Body and send the data via key:value pair in the body of your API request in form-urlencoded manner.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • Request on API via POSTMAN:
    Response of POST Custom API call returns which column is inserted with which value and 1 at the end of response represents the status is successful for inserting data.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • 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 DELETE. After that select the table and select columns based on which you want to delete the data. Choose appropriate conditions according to your requirements and you can add multiple conditions as well by clicking on the Add Condition button on screen.
  • After configuring your API click on Generate API to create Custom API/endpoint.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • After clicking on generate API you’ll be redirected to the Home page of plugin where you can see the details of the Custom API you just created. Custom API can be used on any platform. For passing the information required by your API, you need to follow the format mentioned under Request Body and send the data via key:value pair in the body of your API request in form-urlencoded manner.
  • Custom REST API create API with GET, PUT, POST and DELETE method
  • Request on API via POSTMAN:
    Response of DELETE Custom API call returns the number of rows that are deleted.
  • Custom REST API create API with GET, PUT, POST and DELETE method
Hello there!

Need Help? We are right here!

support
Contact miniOrange Support
success

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com