Calling Rule based APIs

To configure Business Rule , Headers for API and conditions to execute API or not.

3 Likes

Business Rule for API

Business rules are set of statements which returns true or false. Enabling rule based APIs simply means to check whether to execute the API or not , on the basis of business rule configured

There are many scenarios where we need to decide whether to execute API or not, depending on values of request coming from front end. To get this decided , user can configure the set of rules on request body.

Consider an example, where we need to execute API checkBalance, on basis of condition whether account type is saving of not. API will only execute if account type is saving.

Request Body :

Request Body

{

"account_no" : "5674569090" ,

"account_type" : "current"

}

If business rule returns true then only API configured for service will get executed.

User can apply business rule on body of request send for API. He can able to add business rule by selection of “Is Business Rule Required”, Once user select “Y” , a section will be visible to user to add Business rule on request body .

User would be able to configure maximum two business rules basis on the condition “AND” and “OR”.

How to configure ?

  • User will enter the JSON path or value of Left hand side. JSON path will be having format like “$.name.fname”
  • Type : User will select the type of the value which he will be giving in Left and Right hand side of the function . Type can be text (string) or number.
  • Function : This is the operator of condition which user will select to compare the values of both side.
  • User will enter the JSON path or value of right hand side. JSON path will be having format like “$.name.fname”
5 Likes

Business rules are set of statements which returns true or false. Enabling rule based APIs simply means to check whether to execute the API or not , on the basis of business rule configured

There are many scenarios where we need to decide whether to execute API or not, depending on values of request coming from front end. To get this decided , user can configure the set of rules on request body.

2 Likes