API Type Model
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.
Before heading to this section, we need to have some basic understanding about API connections. Let us go through that first.
Pre-requisites
Auth Provider Salesforce Help: Help And Training Community
Auth Provider Trailhead: Set Up Social Sign-On | Salesforce Trailhead
Named Credentials Salesforce Docs: Salesforce Developers
Named Credentials Trailhead: Create HTTP Callout Credentials in Salesforce | Salesforce Trailhead
Connected App Salesforce Help: Help And Training Community
Connected App Trailhead: Create a Connected App | Salesforce Trailhead
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:
References:
Named Creds Blog: Connecting with external application using Rest API
REST API Configuration: REST API Configuration - noKodr-For Salesforce
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.
Details Config | Description |
---|---|
Type | Allows to specify the type of model, such as:
Note: By default, |
Authentication Type | Allows to specify flexible and secure access to integrated applications through following options:
|
Connection | Provides the ability to specify the source (i.e., from various web applications to be integrated with REST APIs) to select records . |
Label | Allows to specify the name of the model. |
Name | Allows to provide unique API name for the model. |
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.
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. |
URL |
| |
Is Array? | Allows to specify whether the data requested from resource should be treated as a single record or multiple records (an array). | |
Type | Allows to specify type of request query argument which will passed to URL, which is basically of two types:
| |
Request Body | Generate Schema | Allows to define object JSON schema which will be passed on to request. |
Create New Field | Allows users to create fields that can be utilized to build an object JSON schema. |
Response
In this tab, user can specify the REST API response that is sent by a server with resource data.
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). | |
Type | Allows to specify type of response which will retrieved through REST request, which is basically of two types:
| |
Response Body | Generate Schema | Allows to define object JSON schema which will be retrieved from response. |
Create New Field | Allows users to create fields that can be utilized to build an object JSON schema that will be received from response. |
Merge Text
Schema Designer
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.
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. |
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.
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. |
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
Field Type
Field Type | Description |
---|---|
Array |
|
Checkbox |
|
Date |
|
Date and Time |
|
Double |
|
Integer |
|
Object |
|
Text |
|