1. What is API?What is API?
General definition of APIs:General definition of APIs:
An application programming interface (API) is a set ofAn application programming interface (API) is a set of
functions, procedures, methods or classes that an operatingfunctions, procedures, methods or classes that an operating
system, library or service provides to support requests madesystem, library or service provides to support requests made
by computer programsby computer programs
2. Examples of famous API:Examples of famous API:
The PC The PC BIOS callBIOS call interfaceinterface
ComediComedi Data Acquisition API Data Acquisition API
Single UNIX SpecificationSingle UNIX Specification (SUS) (SUS)
Windows APIWindows API
The various Java Platform Edition APIs (The various Java Platform Edition APIs (MicroMicro, , StandardStandard, , EnterpriseEnterprise))
ASPIASPI for for SCSISCSI device interfacing device interfacing
CarbonCarbon and and CocoaCocoa for the for the MacintoshMacintosh OSOS
iPhoneiPhone API API
OpenGLOpenGL cross-platform 3D graphics API cross-platform 3D graphics API
DirectX for Microsoft WindowsDirectX for Microsoft Windows
Simple DirectMedia Layer (SDL)Simple DirectMedia Layer (SDL)
Google Maps APIGoogle Maps API
MediaWiki APIMediaWiki API
YouTube APIYouTube API
PayPal Payment ProPayPal Payment Pro
Facebook APIFacebook API
Drupal API (Drupal)Drupal API (Drupal)
3. APIs in TABSAPIs in TABS
APIs are set of functions which can performAPIs are set of functions which can perform
TABS transaction, likeTABS transaction, like
Orders transactionsOrders transactions
Payment transactionsPayment transactions
Cash sales…..etc.Cash sales…..etc.
4. What are the benefits of APIs?What are the benefits of APIs?
Bulk processing:Bulk processing:
For example suppose we need to perform 1000 installation order Of course ifFor example suppose we need to perform 1000 installation order Of course if
we make this through front end this will consume a lot of Time and effortwe make this through front end this will consume a lot of Time and effort
while a back end program can run on a batch of orders and transactionswhile a back end program can run on a batch of orders and transactions
without need to wait for user response.without need to wait for user response.
Expose TABS functionalities:Expose TABS functionalities:
APIs are an interface exposes TABS internal functionality to any otherAPIs are an interface exposes TABS internal functionality to any other
applications. These applications may belong to other TABS process or theapplications. These applications may belong to other TABS process or the
external world for any other third party.external world for any other third party.
E-business:E-business:
APIs can be exposed through web services to be used by any E-businessAPIs can be exposed through web services to be used by any E-business
application and its thin clients; this provides TABS functionality to wide rangeapplication and its thin clients; this provides TABS functionality to wide range
of users including the end user (a subscriber) who can manage hisof users including the end user (a subscriber) who can manage his
subscription profile over the web.subscription profile over the web.
5. What are the main functionalities ofWhat are the main functionalities of
TABS APIs?TABS APIs?
TABS APIs are used for the following fiveTABS APIs are used for the following five
category of actions:category of actions:
Make Order TransactionMake Order Transaction
Make Payment TransactionMake Payment Transaction
Make Cash Sales TransactionMake Cash Sales Transaction
Issue Manual invoiceIssue Manual invoice
Update pre to post paidUpdate pre to post paid
7. File structure of APIsFile structure of APIs
TABS APIs consist mainly of the following filesTABS APIs consist mainly of the following files
APIORD.PCAPIORD.PC
ORMAPI.PCORMAPI.PC
APIUTL.PCAPIUTL.PC
INSTSB.PCINSTSB.PC
NPSB.PCNPSB.PC
MVPPSB.PCMVPPSB.PC
NUCHSB.PCNUCHSB.PC
NACHSB.PCNACHSB.PC
MICHSB.PCMICHSB.PC
TRSFSB.PCTRSFSB.PC
ADCHSB.PCADCHSB.PC
SPCHSB.PCSPCHSB.PC
ARMPAYALLOC.PCARMPAYALLOC.PC
ARMCASHSALES.PCARMCASHSALES.PC
ARMMANUALINV.PCARMMANUALINV.PC
ARMMANUALINV.PCARMMANUALINV.PC
8.
9. APIs CallingAPIs Calling
APIs are group of functions gathered in a group of filesAPIs are group of functions gathered in a group of files
as a library, to call one of them we need to build aas a library, to call one of them we need to build a
standalone application which will call theirstandalone application which will call their
functionality.functionality.
APIORD.PC is an example of a standalone applicationAPIORD.PC is an example of a standalone application
to call them, it represents an entry point to call APIs, asto call them, it represents an entry point to call APIs, as
it can be called from shell command with appropriateit can be called from shell command with appropriate
arguments and then it manages the request and extractarguments and then it manages the request and extract
the required data to be passed to the appropriate APIsthe required data to be passed to the appropriate APIs
functionfunction
15. Calling APIs with batchesCalling APIs with batches
We can build a standalone application e.g.We can build a standalone application e.g.
backend program which can take a list of ordersbackend program which can take a list of orders
request as an input and execute these requests byrequest as an input and execute these requests by
passing it to APIs one by one.passing it to APIs one by one.
This is what we can call a batch execution.This is what we can call a batch execution.
One of the famous existing batches is the batchOne of the famous existing batches is the batch
activation, it is the process of activation a largeactivation, it is the process of activation a large
number of the subscriber.number of the subscriber.
16. Calling APIs with batchesCalling APIs with batches
• The ORMBAPP – Batch front-end routine is used to handleThe ORMBAPP – Batch front-end routine is used to handle
bulk prepaid and post paid service orders, it collects the batchbulk prepaid and post paid service orders, it collects the batch
data and store it into the database.data and store it into the database.
17. Calling APIs with batchesCalling APIs with batches
After that the backend program ORMPRBATCH runsAfter that the backend program ORMPRBATCH runs
the batch orders one by onethe batch orders one by one
dodo
{{
EXEC SQLEXEC SQL
FETCH rows_cursor intoFETCH rows_cursor into
:pos, :S_CONTRNO, :S_CARDNO:S_CARDNO_i, :S_SUBNO;:pos, :S_CONTRNO, :S_CARDNO:S_CARDNO_i, :S_SUBNO;
found = FOUND;found = FOUND;
/* Break is added to avoid processing the order extra time after fetch finishes*//* Break is added to avoid processing the order extra time after fetch finishes*/
if(!found) break;if(!found) break;
memset(&ord,'0',sizeof(struct ORDER));memset(&ord,'0',sizeof(struct ORDER));
fill_ord(i);fill_ord(i);
..
..
..
..
..
..
}while (found);}while (found);
18. Exposing APIs as web servicesExposing APIs as web services
Web Service definition:Web Service definition:
A Web service is software system designed to supportA Web service is software system designed to support
interoperable Machine to Machine interaction over ainteroperable Machine to Machine interaction over a
network. Web services are frequently just applicationnetwork. Web services are frequently just application
programming interfaces (API) that can be accessed over aprogramming interfaces (API) that can be accessed over a
network, such as the Internet, and executed on a remotenetwork, such as the Internet, and executed on a remote
system hosting the requested services.system hosting the requested services.
So, one of the important benefits of APIs is the ability toSo, one of the important benefits of APIs is the ability to
expose TABS functionalities as web services, such that it canexpose TABS functionalities as web services, such that it can
be called by any external channel like E-business.be called by any external channel like E-business.
19. Exposing APIs as web servicesExposing APIs as web services
How Can APIsHow Can APIs
exposed as Webexposed as Web
services?services?
20. Exposing APIs as web servicesExposing APIs as web services
Create an oracle library to map the existing backCreate an oracle library to map the existing back
end APIs UNIX path:end APIs UNIX path:
21. Exposing APIs as web servicesExposing APIs as web services
Create a database package to call the createdCreate a database package to call the created
librarylibrary
22. Exposing APIs as web servicesExposing APIs as web services
Create a database package to be exposed as web service and call the previousCreate a database package to be exposed as web service and call the previous
database package functions:database package functions:
23. Exposing APIs as web servicesExposing APIs as web services
Create a Web Service over the previous database package using aCreate a Web Service over the previous database package using a
development environment like JDeveloper for example.development environment like JDeveloper for example.
24. APIs major functions’ actionsAPIs major functions’ actions
For the functionality of each major functionFor the functionality of each major function
Refer to the document “TABS APIs QuickRefer to the document “TABS APIs Quick
Ref.doc”Ref.doc”