So, we started with the easy part of "file transfers" and "communication exchange", now let's look at the complex part of it; where you want to transfer data but in Realtime and want Realtime responses back from the destination system (When I say "Realtime" it means to transfer the data in milliseconds and get the response back on the same session within a fraction of a second). In today's world where you have applications such as UPI, IMPS, Loan in seconds; For such applications you cannot rely on sftp's and schedulers or managed file transfer systems to do the job, it must be instant (Request / Response)
So how do we achieve that, the answer is API (Application Programming Interface), API is nothing but a Software Interface of any application through which you can interact with it; you can transfer data, you can fetch data, you can pass on commands to change configuration or you can pass on instructions to the application. All in All, APIs makes it very easy for 2 systems to interact with each other in real-time.
So let's take a scenario where we want to transfer data from one database system (DB-A) to another database system (DB-B) using an API, here I am talking about structured data, data which is stored in a database in the form of rows and columns
So, application A has data in DB-A which it wants to send it to the Application B in DB-B
Application-B is hosting an API which can be accessed via a URL, Application A is always connected to DB-A, Application-A picks up the data from DB-A and calls the API on Application-B, converts it into an object (Object is nothing but data written in Key value pairs, nothing complex about it, you just need to imagine that your data from a row is converted into an Object using Key-Value pairs to form an Object), An API call or API communication would always happen using such objects which would be either JSON or XML formatted) phew!!, coming back to the Application-A picking up data from DB-A and converting it into an Object and transferring it via the API connection, once Application-B receives the data object it converts that object into table format and inserts it into its Database (DB-B). So, this is how the API communication works. This is the best way of data exchange and is also useful in a lot of automation practices.
Sometimes APIs maybe called as "Web services" also, since almost every API would have a Http or HTTPs based Service-URL on which this API interaction happens so please don’t get confused when someone says, "We need to make a “”Web services call” to that application”, they are not referring to anything else other than API
The most common use case for API in a financial institution would be Realtime transactions which happen in their core databases, they are all happening via API, for e.g., In Banking your Core Banking database would be connected to your Core Banking Application which hosts all the APIs by which the instant Debit/Credit happens in a customer account, especially the ones which takes place via channels such as IMPS and UPI.
There are 2 Major types of APIs which most organizations deploy.
REST (Representational State Transfer) and SOAP(Simple Object Access Protocol) out of which REST is more popular since it can use multiple formats of messages such as JSON, XML, HTML and also plain text whereas SOAP only works with XML
Note: I have taken an example of data transfer here as it is the most used use-case for APIs, but APIs can be used for N number of processes such as passing instructions or changing configuration on devices