Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Overview

  • API Type Model solely focuses on integrating with external web applications by using REST APIs, allowing seamless data retrieval and management from various web sources.

  • These models handle data exchange and can be bound various components, enabling efficient data display and interaction across various layouts.

image-20240926-062619.png
  • Before heading to this section, we need to have some basic understanding about API connections. Let us go through that first.

Pre-requisites

This will give an idea about Auth Provider and its configuration, Named Credentials and its configuration as well as Connected App for OAuth settings. Also, if you want to completely go through this you can refer:

In this section, you can see various option while creation model for API types let’s understand each:

  • Let’s explore the screens that follow, after clicking on Model Creation + button and Type as API.

Details

In this tab, user can specify the REST API Connection for integration and its details, on whose basis model is to be created.

image-20240926-062619.png

Details Config

Description

Type

Allows to specify the type of model, such as:

  • API: For integrating with external applications via REST APIs.

  • Record: For managing Salesforce & few other CRM object data.

Note: By default, Type is set as Record.

Authentication Type

Allows to specify flexible and secure access to integrated applications through following options:

  1. Session: Uses active session details for authentication i.e., if a user wants to perform REST operations in self org.

  2. Public: Provides access without requiring user credentials i.e., if a user wants to access public APIs such as Google's Weather API.

  3. Connection: Authenticates using established REST API connection with external web applications such as accessing Quickbooks.

Connection

Provides the ability to specify the source (i.e., from various web applications to be integrated with REST APIs) to select records .

Note: This field is only visible when Authentication Type is set as Connection.

image-20240926-072229.png

Label

Allows to specify the name of the model.

Note: In case of Authentication Type set as Connection, after specifying Connection, this field auto-populates, mirroring the connection label.

Name

Allows to provide unique API name for the model.

Note: In case of Authentication Type set as Connection, after specifying Connection, this field auto-populates, replicating the connection label in camel case.

Execute on Load

Enables records to be fetched automatically upon loading the component.

Request

In this tab, user can specify the REST API request that is sent to a server to access resource data.

image-20240926-073509.png

Request Config Group

Config Name

Description

Request Parameters

Method

Allows to specify HTTP method among different HTTP methods such as GET, POST, PATCH, etc. are used to perform specific operations on resources. You can explore more about methods by clicking here.

Note: By default, Method is set as Post.

URL

  • Allows to add the relevant URL that corresponds to the connection from which user wishes to perform CRUD.

  • User has also accessibility to specify URL dynamically using Merge Text.

Reference: Merge Text

Is Array?

Allows to specify whether the data requested from resource should be treated as a single record or multiple records (an array).

Notes:

  • When enabled, it allows handling multiple records as a list, suitable for displaying data in components like Tables or Repeater.

  • When disabled, it treats the data as a single record, ideal for components like Form.

  • By default, Is Array is disabled.

Type

Allows to specify type of request query argument which will passed to URL, which is basically of two types:

  • Object: Query argument passed to the URL will be JSON body or Object.

  • String: Query argument passed to the URL will be a s string.

Note: When Is Array? is enabled, the Type is automatically set to Object by default and cannot be changed.

Request Body

Generate Schema

Allows to define object JSON schema which will be passed on to request.

Reference: Schema Designer

Create New Field

Allows users to create fields that can be utilized to build an object JSON schema.

Note: When a new field is created, it will be automatically mapped in JSON structure of Generate Schema as follows:

image-20240926-101731.pngimage-20240926-101818.png

Reference: Schema Designer

Response

In this tab, user can specify the REST API response that is sent by a server with resource data.

image-20240926-093441.png

Response Config Group

Config Name

Description

Response Parameters

Status Code

It indicates whether a specific HTTP request has been successfully completed.

Is Array?

Allows to specify whether the data retrieved from resource should be treated as a single record or multiple records (an array).

Notes:

  • When enabled, it allows handling multiple records as a list, suitable for displaying data in components like Tables or Repeater.

  • When disabled, it treats the data as a single record, ideal for components like Form.

  • By default, Is Array is disabled.

Type

Allows to specify type of response which will retrieved through REST request, which is basically of two types:

  • Object: Provides a structured response that includes detailed data such as headers, response codes, and other relevant information

  • String: Offers a simpler text-based response.

Notes:

  • When Is Array? is enabled, the Type is automatically set to Object by default and cannot be changed.

  • The Object allows returning HTTP data along with your method's response, offering details like headers and response codes, which a String cannot provide. While using a String is sufficient for many cases, utilizing the Object can be more beneficial and convenient.

Response Body

Generate Schema

Allows to define object JSON schema which will be retrieved from response.

Reference: Schema Designer

Create New Field

Allows users to create fields that can be utilized to build an object JSON schema that will be received from response.

Note: When a new field is created, it will be automatically mapped in JSON structure of Generate Schema as follows:

image-20240926-101731.pngimage-20240926-101818.png

Reference: Schema Designer

Merge Text

Merge Text

Merge text is a key feature of the noKodr application, allowing users to display field values on the UI. Depending on the data type, users can perform mathematical operations on these fields.

For example, if you want to display a calculated total price based on the quantity and unit price entered by the user on a sales order form, and you wish to dynamically showcase this on the UI without saving the record in the database, you can achieve this using the UI fields in noKodr.

After selecting merge text you can you can see several options such as:

Merge text popup.png

Attribute Name

Description

Source Type

In this option, you can select various sources from which you want to display values.

Value

The available options will change depending on the selected source type. For example, if you choose "Static" as the source, you can provide a fixed static value.

Merge Field Expression

The selected field from the source will be displayed in a merge format. For instance, the first name field from the contact model will appear as: {model:contact.FirstName}.

Message Body

In this option, You can add multiple values to form your final UI merge text.

For example, merge fields include {model:contact.FirstName},{model:contact.LastName} will eventually display the contact's first name and last name next to each other.

Available Sources

After clicking on the Gear Icon, you can select various sources to include fields or values, such as variables, other models, static values, etc.

Merger text sources.png

Source Type

Description

Static

Use this option to provide a fixed static value.

Field

Select the field from the chosen object in the model whose value you want to include.

Model

Choose the field from other models whose value you want to include.

Variable

Select from the variables created in the layout whose value you want to use.

Cookie Key

Choose the available cookie key whose value you want to include from your browser.

Local Storage Key

Select the available Local Storage Key whose value you want to include from your browser.

User

You can also select fields from the current logged-in user in your organization to include in the merge.

Note: The User source refers to the currently logged-in user in your organization. This means that if you include the First Name field from the user, each time a different user logs in, they will see their own First Name displayed.

After selecting the source type, you need to choose the available options based on the selected type. For example, if you have selected "Model" as the source type, you will need to select one model from the available models.

Note: Only single record models are visible here and can be used in the merge text. Multi-record models are not supported here.

Merge text model.png

Once you select a model, the field options will become available. You can then choose the fields you want to include in your merge field expression and combine multiple fields to form your final expression in the message body.

Merge text final.png

Schema Designer

image-20240926-100429.png

Generate Schema

  • A Generate schema typically refers to the process of defining or creating a structured format that outlines how data is organized, validated, and transmitted, especially in contexts like APIs or databases.

  • In noKodr, users can define fields using JSON format.

image-20240826-051441.png

Button

Description

Cancel

It allows the user to exit the "Generate Schema" process. If any changes were made in the modal, they will be discarded, and no new schema will be generated.

Recreate

It is used to reset the schema creation form within the modal. All fields will be cleared or set to their default values, enabling the user to begin the process of defining a new schema from scratch.

Merge

It allows the user to merge the newly generated schema with an existing schema. This is useful when the user wants to integrate new schema elements into a pre-existing schema without completely overwriting it.

Reference: Schema

Create New Field

  • In cases where a user does not have data in XML format but has it in JSON format, the application allows the user to create a schema by adding new fields directly.

  • This feature is particularly useful for users who need to generate or modify schemas based on their JSON data structure.

image-20240826-052630.png

Field Config

Description

Name

The identifier for the field within the schema. This is the name that will be used to reference the field in the data structure.

Type

It specifies the data type of the field.

Note: By default, field type is text.

Reference: Field Type

Required

It indicates whether the field is mandatory.

Minimum Length

It defines the minimum number of characters or elements that the field must contain.

Maximum Length

It defines the maximum number of characters or elements that the field must contain.

Pattern

It is a regular expression that the field’s value must match. This is typically used for validating formats like email addresses, phone numbers, etc.

Help Text

It provides additional information or guidance on what the field represents and how it should be used. This is often displayed in the UI to assist users.

Default Value

It is a predefined value that the field will take if no other value is provided. This helps in setting initial values.


Schema

image-20240826-050822.png

Field Type

Field Type

Description

Array

  • It represents a collection of items, where each item can be of the same type or a specified set of types.

  • Arrays are useful for storing lists or multiple values under a single field.

For example, A list of user roles in a system: ["admin", "editor", "viewer"]

Checkbox

  • It represents a boolean value, typically used in forms to indicate a true/false or yes/no option.

  • This field type is ideal for settings or preferences that can be toggled on or off.

For example, A Subscribe to newsletter option

Date

  • It stores a date value without time information.

  • This type is used when only the date is relevant, such as a birthdate or a specific event date.

For example, "2024-08-26"

Date and Time

  • It stores both date and time information.

  • This is used when the exact moment of an event is important, such as timestamps for record creation or updates.

For example, "2024-08-26T14:30:00Z"

Double

  • It represents a floating-point number, suitable for storing decimal values or precise measurements.

  • This type is ideal for fields that require numeric data with fractions.

For example, 1234.56

Integer

  • It represents a whole number without any decimal points.

  • This type is used for counting or indexing, such as user IDs, quantity fields, or age.

For example, 42

Object

  • It represents a structured data type that can contain multiple named properties, each with its own type.

  • Objects are used for more complex data structures, such as nested entities.

For example,

image-20240826-061126.png

Text

  • It stores plain text, which can be a short string or a longer block of text.

  • This field type is used for any data that needs to be expressed in words, such as names, descriptions, or comments.

For example, "This is a sample text field."

image-20240926-101049.png

String type offers a simpler text-based response thus data will be of Text type, which will be set by default.

  • No labels