Making a SUSI Skill to get details about bank from IFSC
We are going to make a SUSI skill that fetches information about a bank when the IFSC (Indian Financial System Code) is known. Here is a detailed explanation of how we going about doing this. Getting started with the skill creation API endpoint that returns the bank details Before going to the skill development, we need to find an API that would return the bank details from the IFSC, On browsing through various open source projects. I found an apt endpoint by Razorpay. Razorpay is a payment gateway for India which allows businesses to accept, process and disburse payments with ease. The Github link to the repository is https://github.com/razorpay/ifsc. API endpoint - https://ifsc.razorpay.com/<:ifsc> Request type - GET Response type - JSON Now, head over to the SUSI Etherpad, which is the current SUSI Skill Development Environment and create a new Pad. Here, we need to define the skill in the Etherpad. We will now write rules/intents for the skill. An intent represents an action that fulfills a user's spoken request. Intents consist of 2 parts - User query - It contains different patterns of query that user can ask. Answer - It contains the possible answer to the user query. The main intent that our skill focuses on is, returning the bank name and address from the IFSC code. Here is how it looks - Name of bank with IFSC code * | Bank's name with IFSC code * !example:Name of bank with IFSC code SBIN0007245 !expect: The name of bank is State Bank of India !console:The name of bank with IFSC code $1$ is $object$ { "url":"https://ifsc.razorpay.com/$1$", "path":"$.BANK" } eol Part-wise explanation of the intent The first line contains the query pattern that the user can use while querying. You can see that a wildcard character (*) is used in the pattern. It contains the IFSC of the bank that we wish to know, and will later on use to fetch the details via the API. The second line contains an example query, followed by third line that contains the expected answer. Last part of the rule contains the answer that is fetched from an external API - https://ifsc.razorpay.com/<:ifsc> ,via the console service provided by SUSI Skills. Here, <:ifsc> refers to the IFSC that the user wants to know about. We get it from the user query itself, and can access it by the variable name $1$ as it matches with the 1st wildcard present in the query. If there would be 2 wildcards, we could have accessed them by $1$ and $2$ respectively. The console service provides us with an option to enter the url of the API that we want to hit and path of the key we want to use. The sample response of the endpoint looks like this : { "BANK": "Karnataka Bank", "IFSC": "KARB0000001", "BRANCH": "RTGS-HO", "ADDRESS": "REGD. & HEAD OFFICE, P.B.NO.599, MAHAVEER CIRCLE, KANKANADY, MANGALORE - 575002", "CONTACT": "2228222", "CITY": "DAKSHINA KANNADA", "RTGS": true, "DISTRICT": "MANGALORE", "STATE": "KARNATAKA" } Since, we want…
