API Registration
This feature allows you to add one or more APIs to a service. If you add more than one API to the service, you need to define the sequence to execute APIs sequentially. Based on configured sequence, the APIs will execute in a specific sequence or order. The sequential execution pattern of the multiple APIs in a service container imparts the function of API orchestration.
To register an API:
- On the home page of the vConnect module, find the Service Management tab.
- Click the Service Management tab, and then click Add New Service, and the application displays the Service Details page.
- Click the API Registration tab, and the application displays the configuration-related properties.
- On the API Registration page, enter the API configuration details as follows:
API’s Common Configuration Details
API?s common configuration includes the configuration of the following properties:
Lists/Box | Description |
Backend System | Click this list, and then select the type of the API (For example: – REST/SOAP) that you have created. |
API Name | Click this list, and then select the API?s name (For example: – Test_API) that you have created earlier. |
API Version | Click this list, and then select the API?s version that you want to register. This box displays multiple versions of an API if you have updated the respective API repeatedly and maintained its different versions. |
Sequence | In this box, enter a numeric value that specifies the sequence number. The sequence number specifies the sequence number at which the API will execute if the service has multiple APIs that execute sequentially. For instance: – In the Sequence box, if you enter 2, the current API will execute after the first API executes. |
Is Caching Required | Click this list, and then select one of the following values: 1. Select Y to store the data of the API request in the cache. 2. Select N to not store the data of the API request in the cache. |
Execution Type | Click this list and then select one of the following values: 1. SYNC:- If you select this value, the current API will execute after the previous API successfully completes its job. 2. ASYNC If you select this value, the current API will execute along with other APIs in a parallel manner. |
Platware Client Configuration
API’s Platware Client configuration includes the configuration of the following properties:
List/Box | Description |
Response Handled By | Click this list and then select one of the following values: 1. PWC:- If you select this value, PWC will handle the API response. 2. Mobile App If you select this value, the mobile app will handle the API response. |
Tracing
The “Tracing” includes the configuration of the following properties:
List/Box | Description |
Is Tracing | In this list: 1. Select Y if you want to maintain the communication logs of the respective API. 2. Select N if you do not want to maintain the communication logs of the respective API. |
Record’s Primary Key | In this box, enter the primary or unique key of the database column if the API fetches the data from database view. |
Success Rule | In this box, enter a logic based on the response of the API. If the API returns the required data in the response, the success rule will execute. The success rule’s execution means that the API performed its job successfully. |
Retry
While registering the API, this property enables the application to invoke an API for a specified number of times if it fails to invoke the API. You can configure the Retry property as follows:
Field/Box | Description |
Is Retry Required | When you click this check box, the Retry property becomes active. After you click the Is Retry Required check box, three other properties come into view as follows: 1. Max Retry 2. Retry Delay 3. Business Rule |
Max Retry | In this field, enter a numeric value (for example, 5). This numeric value specifies the maximum number of tries that the application will make to invoke an API. |
Retry Delay (ms) | In this field, enter a numeric value (for example, 3000) in milliseconds. This numeric value specifies the time difference between two consecutive tries that the application makes to invoke an API. |
Is Business Rule Required | You can use this property to configure a business rule. If the user’s action satisfies the condition inside the business rule, the application will retry to invoke an API. Click the Is Business Rule Required list and then select one of the following values: 1. N Selecting this value does not apply the business rule to the Retry property. 2. Y When you select this value, the Add New Business Rule link comes into view. Click Add New Business Rule to configure a new business rule. |
Other Miscellaneous Configuration
The other configuration details include the following properties:
List/Box | Description |
HTTP Method | Click this list and then select one of the following HTTP method: –> Get:- This method reads the data from the server. –> Post:- This method updates or writes the data on the server. |
API Category | In this list, select one of the following values: –> Admin Select this value if the API performs the administration related work at the application level. –> Transactional Select this value if the API processes the transactional data or manipulates the data at the application level. |
Parallel Thread | In this box, enter the number of threads that you want the API to use for data exchange and processing. |
Record Timeout | In this box, enter the time in seconds (For example: – 120). This value specifies the timeframe after which the API will display the error if it does not receive the expected result. |
Is Response Required | Click this list, and then select one of the following values: Y: – Select this value if you want the API to receive the response from the server. N: – Select this value if you want the API to not receive the response from the server. |
Is Business Rule Required | Click this list, and then select one of the following values: Y: – Select this value to apply the business rule to the API configuration. For successful execution, the API needs to satisfy the condition in the business rule. N: – Select this value to not apply the business rule to the API configuration. |
Response Required On Business Rule Failure | Click this list and then select one of the following values: i. Y: – Select this value to receive the error type response message if the API fails to satisfy the condition inside the business rule. ii. N: – Select this value to not receive the error type response message if the API fails to satisfy the condition inside the business rule. |
Add New Business Rule | Click Add New Business Rule to apply a new business rule to the API?s configuration. To apply the business rule, perform the following steps: a. Click Add New Business Rule, and the Business Rule 1 area expands. b. Click the Apply Business Rule to list, and then select one of the followings: c. REQUEST_BODY:- Select it to apply the business rule on the body of the API request. d. HEADER: – Select it to apply the business rule on the body of the API request. e. To apply the business rule to one of these two sections of the API, let?s discuss the two following cases: Case1:- (In the Apply Business Rule to list, when you select REQUEST_BODY) –> Click the Operands Data Type list, and then select: i. Number: – If you want the business rule to check and validate a numeric value in the business rule. ii. Text: – If you want the business rule to check and validate a text based value in the business rule. –> In the first JSON Path/value box, enter the JSON path or static value that you want to validate. In the case of the JSON path, the business rule will check and validate the value that the JSON path stores. –> In the Select Value list, select a pre-defined expression to define the condition (For example: – NOT_EQUAL) of the business rule. –> In the second JSON Path/value box, enter the JSON path or static value against which the business rule checks the value that is entered in the first JSON Path/value box. Case2:- In the Apply Business Rule to list, when you select HEADER –> Click the Operands Data Type list and then select: i. Number: – If you want the business rule to check and validate a numeric value in the business rule. ii. Text: – If you want the business rule to check and validate a text based value in the business rule. –> In the Key box, enter the name of the parameter of the API?s header section. –> In the Select Value list, select a pre-defined expression to define the condition (For example: – NOT_EQUAL) of the business rule. –> In the Value box, enter a value that the business rule validates against the value of the parameter/key. Note: – To add another business rule, repeat these steps. While adding more than one business rule, you can define the ?And? or ?Or? condition so that the API either satisfies all rules or one of the rules, respectively. |
Adding Extra Headers to Backend System
To configure additional header details, see the post: Configuring End Point Header Details in the API Management category.