How to use application API

This tutorial shows you how to use API of your application. We will show you how to do login request to your application with JavaScript AJAX request from other applications. Also we will show you how to process button in your application from another applications with JavaScript AJAX request and how to create links to different pages in your application.

1. How to process button in your application from other web application:

$.ajax({
  type: 'POST',
  url: "http://demo.izzedoappbuild.com/AjaxProxy.php",
  dataType: 'json',
  data: {
    "functionName": 'Functions.Core.ProcessActions.ProcessButton',
    "parameters": {
      "formData": {
        "TextboxNameRegistration": $("#name").val(),
        "TextboxLastNameRegistration": $("#lastName").val(),
        "TextboxEmailRegistration": $("#email").val(),
        "PasswordRegistrationNewUser": $("#password").val()
      },
      "buttonName": "ButtonRegister"
    },
    "token": ""
  },
  success: function (response) {
    if (response.status == true) {
      // Button actions successfully completed.
    } else {
    }
  },
  error: function (jqXHR, textStatus, errorThrown) {
  }
});

2. How to do login request to your application:

$.ajax({
  type: 'POST',
  url: "http://demo.izzedoappbuild.com/AjaxProxy.php",
  dataType: 'json',
  data: {
    "functionName": 'Functions.Core.Login.LoginUser',
    "parameters": {
       'userName': $('#emailLogin').val(),
       'userPassword': $('#lozinkaLogin').val()
    }
  },
  success: function (response) {
    if (response.status == true) {
      loggedUser = response.data;  //Logged user information
    } else {
    }
  },
  error: function (jqXHR, textStatus, errorThrown) {
  }
});

You can do request to other function in your custom plugins. Request parameter functionName should be in format: ‘Functions.Plugins.PluginName.FunctionName’.

3. How to get data of data table in your application from other web application:

$.ajax({
  type: 'POST',
  url: "http://demo.izzedoappbuild.com/AjaxProxy.php",
  dataType: 'json',
  data: {
    "functionName": 'Functions.Core.ComponentsHTML.GetDataTableData',
    "parameters": {
      "dataTableName": "dataTableProduct",
      "formData": '',
    },
    "token": loggedUser["token"] // From previous example
  }
  success: function (response) {
    if (response.status == true) {
      dataTableData = response.data; // Data from data table.
    } else {
    }
  },
  error: function (jqXHR, textStatus, errorThrown) {
  }
});

In our previous examples we used POST requests, also we can you GET requests to process buttons or process menu item to access page in application.

4. How to process button with GET requests:
http://demo.izzedoappbuild.com/AjaxProxy.php?functionName=Functions.Core.ProcessActions.ProcessButton&formData[SingleselectSearchProductCategory]=1&buttonName=ButtonProductSeach&wholePage=Yes

This GET request will process button ButtonProductSearch with SingleselectSearchProduct parameter.

5. How to process menu item:
http://demo.izzedoappbuild.com/AjaxProxy.php?functionName=Functions.Core.ProcessActions.ProcessMenuItem&menuItemName=MenuitemRegistration&wholePage=Yes

This GET request will process menu item MenuitemRegistration. wholePage=Yes parameter tells application to show application navigations, other elements and CSS style.