Body Field

The Body Field section allows you to configure the data that will be sent with your API request. This is particularly useful when making POST or PUT requests, where you need to submit data such as form inputs, JSON objects, or other structured information. Below is a breakdown of each element and instructions on how to configure them.


Body Field (Toggle)

  • Field Purpose: This toggle enables or disables sending data in the body of the request. When enabled, it allows you to add dynamic data to be included in the API call’s request body.

  • How to Configure:

    • Turn the toggle on to enable the body field.

    • This is typically used when you need to send data with your request (e.g., in a POST request).

Input Binding: Used when you are sending an action or data to an API (like submitting a form or creating a resource).

Output Binding: Used when you are retrieving data from an API (like getting weather information or transaction details).

Both Input and Output Binding: Used when you send data and expect a response that you need to map and use in the system (like submitting a request and getting confirmation or feedback).


2. Input Binding

  • Field Purpose: This section is used to bind dynamic data (variables) to your API request.

    Available Options:

    • Variables:

      • Purpose: These represent dynamic placeholders that will be filled with actual values from the conversation or procedure context. This ensures the API request uses real-time values from user interactions.

      • How to Configure: Select the variables you want to include in the request body, such as user ID, phone number, or product details.

    • Payload Constructor:

      • Purpose: This allows you to construct a structured payload by mapping context or conversation variables to the correct fields in the request.

      • How to Configure: Map the necessary context variables (e.g., userid, tanggal_pembelian, kode_barang) to their corresponding fields in the API request body.


3. Output Binding

  • Field Purpose: This section defines how the response data from the API is mapped to specific fields in the system.

    Options:

    • Response Construction:

      • Purpose: Maps the API’s response data to specific fields or variables in the system, ensuring the returned data can be processed or displayed correctly.

      • How to Configure: Define which fields from the response data should be mapped to system fields or stored for further use (e.g., mapping a list of hospitals to the hospital_list field).


4. Output Description

  • Field Purpose: This is a descriptive field that explains how the API response will be handled and processed in the system. It provides clarity for users or developers who may interact with the system in the future.

  • How to Configure:

    • Enter a brief description explaining how the system will manage the API’s response.

    • Example: "The API returns a list of hospitals, which is mapped to the hospital_list field and displayed in a dropdown menu for the user."

Last updated