API Builder Method Creation and Properties Panel

Once the API Builder is created, you can start defining a new method by clicking the ADD NEW METHOD button in the upper right corner of the screen. After this step, you can set a name for the method and configure the properties of the method. During the method creation process, you can use the Properties panel on the right side of the screen to authorize and add actions. You can delete or rename the methods you created at any time.

Fields in Properties Panel:

  1. Authorization: You can determine the use of the API with authorization options. If you want the API to be used by everyone without any authentication, you can select Anonymous Access. You can also use the All Roles Access option to make it available to all roles.
  2. Add Actions: Allows you to add platform actions that you want to run when the method is called. If the method needs to perform an action via API, you can define an action here.

        3. Method Input: If your method will work by taking a specific input value, you can define input properties through this field. These properties include details such as input name and type.

Example Scenario: Using API Method Structure

For example, let's say you are developing an application that serves menu content. In this application, you may want to take a Barcode number as input and return the status code as respons.

  1. First, create a new Custom Action using the Custom Actions panel in the UI Design module or the Datasources module. This Custom Action will take an input and return a status code as a result.

You can write the necessary queries by entering the SQL Editor field. The SQL editor accepts queries that you write by hand or queries created with the help of artificial intelligence. For example, you can add the following query:

SELECT Barcode, Status FROM Menu WHERE Barcode = @Barcode

      2. Give your action a name (for example, Status Inquiry) and click the CREATE button. To call this action into an API Method, click the +ADD ACTION button and add the action by typing Status Inquiry in the search bar.

      3. Define the parameter of the created action as Action Results → Status Inquiry via Symbol Picker.

      4. The Barcode parameter you specified with "@" in the SQL Editor must be opened to the API as an external method input. For this, click the +ADD METHOD INPUT button, type Barcode in the Input Name field, set the input type as Guid and click the Create button.

The action you created is ready to receive external parameters and execute SQL queries. Click the Preview button to test all configurations. As a result of the preview, you can view your API and the added method operations by clicking Swagger in the URL section. You can set whether these operations can be viewed only by logged in users or by everyone in the Authorization field in the Properties panel.