SlideShare a Scribd company logo
1 of 24
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
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)
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.
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.
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
Logical structure of APIsLogical structure of APIs
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
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
OrdersOrders
 apiord [-d[123456789] -e -n -t -c] O SOTYPEapiord [-d[123456789] -e -n -t -c] O SOTYPE
[Subno] [User] [Promotion|NULL][Subno] [User] [Promotion|NULL]
[ServiceDetail|NULL] [SUBSIDY_FLAG][ServiceDetail|NULL] [SUBSIDY_FLAG]
[SendSwitchCMD:Y|N][SendSwitchCMD:Y|N]
ServiceDetail: [I|D,EQUIPID,LoginId|NULL,SerialNo|NULL]....ServiceDetail: [I|D,EQUIPID,LoginId|NULL,SerialNo|NULL]....
EX: I,ACCESS,NULL,NULL+D,CLIP|...EX: I,ACCESS,NULL,NULL+D,CLIP|...
[SUBSIDY_FLAG:Y|N] [SendSwitchCMD:Y|N ][SUBSIDY_FLAG:Y|N] [SendSwitchCMD:Y|N ]
PaymentPayment
 apiord [-d[123456789] -e -n -t -c] P [PayAgainst] [Subno|Contrno,Amount]apiord [-d[123456789] -e -n -t -c] P [PayAgainst] [Subno|Contrno,Amount]
[Username] [Paymode] [ChqDetails|NULL] [CardDetails|NULL] [EquipDetails|[Username] [Paymode] [ChqDetails|NULL] [CardDetails|NULL] [EquipDetails|
NULL] [InvDetails|NULL] [AdvDetails|NULL] [CheckSubscriber] [Currency]NULL] [InvDetails|NULL] [AdvDetails|NULL] [CheckSubscriber] [Currency]
[Payment_For] [Pay_Future_invocies] [L_sIsDepositRefund][Payment_For] [Pay_Future_invocies] [L_sIsDepositRefund]
[L_sIsAdvancePayContrno][L_sIsAdvancePayContrno]
 PayAgainst: [S|C]PayAgainst: [S|C]
 ChqDetails[Bank_code, Bank_branch,Cheque_number,Bank_account_id,ExpDate] andChqDetails[Bank_code, Bank_branch,Cheque_number,Bank_account_id,ExpDate] and
 ExpDate:DDMMYYYYExpDate:DDMMYYYY
 CardDetails:[CardNo,IssUser, ExpDate,VerifNo] and ExpDate:MMYYYYCardDetails:[CardNo,IssUser, ExpDate,VerifNo] and ExpDate:MMYYYY
 EquipDetails:[Subno,EquipId,Amount]EquipDetails:[Subno,EquipId,Amount]
 InvDetails: [InvoiceNo,amount]InvDetails: [InvoiceNo,amount]
 AdvancePayment: [Subno,SubscrType,Area,Amount]AdvancePayment: [Subno,SubscrType,Area,Amount]
 CheckSubscriber: '[Y|N]CheckSubscriber: '[Y|N]
 Currency like SARCurrency like SAR
 Payment_For:DEP|INV|NON|NULLPayment_For:DEP|INV|NON|NULL
 Pay_Future_invocies:Y|NPay_Future_invocies:Y|N
 L_sIsDepositRefund:Y|NL_sIsDepositRefund:Y|N
 L_sIsAdvancePayContrno:Y|NL_sIsAdvancePayContrno:Y|N
Cash SalesCash Sales
 apiord [-d[123456789] -e -n -t -c] C [Contrno] [Subno|NULL]apiord [-d[123456789] -e -n -t -c] C [Contrno] [Subno|NULL]
[Amount] [Contact Number|NULL] [EquipDetails|NULL][Amount] [Contact Number|NULL] [EquipDetails|NULL]
[Username] [Paymode] [PayDate:YYYY-MM-DD] [CardDetails|[Username] [Paymode] [PayDate:YYYY-MM-DD] [CardDetails|
NULL] [ChqDetails|NULL] [Note|NULL] [Rc_name|NULL]NULL] [ChqDetails|NULL] [Note|NULL] [Rc_name|NULL]
[DiscountDetail] [CheckPrice] [Currency][DiscountDetail] [CheckPrice] [Currency]
 CardDetails:[CardNo,IssUser,ExpDate(YYYYMMDD),VerifNo]CardDetails:[CardNo,IssUser,ExpDate(YYYYMMDD),VerifNo]
 ChqDetails[Bank_code, Bank_branch,Cheque_number]ChqDetails[Bank_code, Bank_branch,Cheque_number]
 EquipDetails:EquipDetails:
[EquipId,Amt,Amt_int,Qty,Frm_serial,To_Serial,SubsidySubNo,Subsidy[EquipId,Amt,Amt_int,Qty,Frm_serial,To_Serial,SubsidySubNo,Subsidy
Area,SubsidySubtype]Area,SubsidySubtype]
 DiscountDetail:[DiscountAmount,DiscountPercent]DiscountDetail:[DiscountAmount,DiscountPercent]
 CheckPrice: '[Y|N]CheckPrice: '[Y|N]
 Currency Like SARCurrency Like SAR
Issue Manual InvoiceIssue Manual Invoice
 apiord [-d[123456789] -e -n -t -c] I 01 [contrno]apiord [-d[123456789] -e -n -t -c] I 01 [contrno]
[subno] [area] [subscr_type] [amount] [vat_amt][subno] [area] [subscr_type] [amount] [vat_amt]
[user_name][user_name]
Pre-Paid To Post-Paid MigrationPre-Paid To Post-Paid Migration
 apiord [-d[123456789] -e -n -t -c] I 02 [contrno]apiord [-d[123456789] -e -n -t -c] I 02 [contrno]
[subno] [cardno] [transno] [transdate (DD-[subno] [cardno] [transno] [transdate (DD-
MON-YYYY)] [substatus] [balance] [ar_ref]MON-YYYY)] [substatus] [balance] [ar_ref]
[transstatus] [error_code] [error_msg] [logname][transstatus] [error_code] [error_msg] [logname]
[logdate (DD-MON-YYYY)] [processed_by][logdate (DD-MON-YYYY)] [processed_by]
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.
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.
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);
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.
Exposing APIs as web servicesExposing APIs as web services
 How Can APIsHow Can APIs
exposed as Webexposed as Web
services?services?
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:
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
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:
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.
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”

More Related Content

Similar to TABS APIs

z/OS Connect - Overview at the "z Systems Agile Enterprise Development Confer...
z/OS Connect - Overview at the "z Systems Agile Enterprise Development Confer...z/OS Connect - Overview at the "z Systems Agile Enterprise Development Confer...
z/OS Connect - Overview at the "z Systems Agile Enterprise Development Confer...DevOps for Enterprise Systems
 
Magento's Imagine eCommerce Conference 2011 - Mash-up of Magento and Salesfor...
Magento's Imagine eCommerce Conference 2011 - Mash-up of Magento and Salesfor...Magento's Imagine eCommerce Conference 2011 - Mash-up of Magento and Salesfor...
Magento's Imagine eCommerce Conference 2011 - Mash-up of Magento and Salesfor...MagentoImagine
 
Oracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons LearntOracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons Learntluisw19
 
Api development with rails
Api development with railsApi development with rails
Api development with railsEdwin Cruz
 
Openshift Container Platform: First ItalyMeetup
Openshift Container Platform: First ItalyMeetupOpenshift Container Platform: First ItalyMeetup
Openshift Container Platform: First ItalyMeetupGiuseppe Bonocore
 
apidays LIVE New York - API Code First vs Design First by Phil Sturgeon
apidays LIVE New York - API Code First vs Design First by Phil Sturgeonapidays LIVE New York - API Code First vs Design First by Phil Sturgeon
apidays LIVE New York - API Code First vs Design First by Phil Sturgeonapidays
 
What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...Kim Clark
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsSashko Stubailo
 
apidays LIVE Paris - Bring the API culture to DevOps teams by Christophe Bour...
apidays LIVE Paris - Bring the API culture to DevOps teams by Christophe Bour...apidays LIVE Paris - Bring the API culture to DevOps teams by Christophe Bour...
apidays LIVE Paris - Bring the API culture to DevOps teams by Christophe Bour...apidays
 
Serverless in Swift like a Breeze
Serverless in Swift like a BreezeServerless in Swift like a Breeze
Serverless in Swift like a BreezeAndrea Scuderi
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...Ted Chien
 
SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01Argos
 
OSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
OSCamp #4 on Foreman | CLI tools with Foreman by Martin BačovskýOSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
OSCamp #4 on Foreman | CLI tools with Foreman by Martin BačovskýNETWAYS
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyManageIQ
 
Usda ocio-its itsm7-integration_architecturediagram_v1_100109
Usda ocio-its itsm7-integration_architecturediagram_v1_100109Usda ocio-its itsm7-integration_architecturediagram_v1_100109
Usda ocio-its itsm7-integration_architecturediagram_v1_100109Accenture
 
Costruire applicazioni multi-tenant e piattaforme SaaS in PHP con Innomatic
Costruire applicazioni multi-tenant e piattaforme SaaS in PHP con InnomaticCostruire applicazioni multi-tenant e piattaforme SaaS in PHP con Innomatic
Costruire applicazioni multi-tenant e piattaforme SaaS in PHP con InnomaticInnoteam Srl
 
R2D2- Personal assistant on android.
R2D2- Personal assistant on android.R2D2- Personal assistant on android.
R2D2- Personal assistant on android.Mohd Nazim
 

Similar to TABS APIs (20)

z/OS Connect - Overview at the "z Systems Agile Enterprise Development Confer...
z/OS Connect - Overview at the "z Systems Agile Enterprise Development Confer...z/OS Connect - Overview at the "z Systems Agile Enterprise Development Confer...
z/OS Connect - Overview at the "z Systems Agile Enterprise Development Confer...
 
Magento's Imagine eCommerce Conference 2011 - Mash-up of Magento and Salesfor...
Magento's Imagine eCommerce Conference 2011 - Mash-up of Magento and Salesfor...Magento's Imagine eCommerce Conference 2011 - Mash-up of Magento and Salesfor...
Magento's Imagine eCommerce Conference 2011 - Mash-up of Magento and Salesfor...
 
Oracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons LearntOracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons Learnt
 
Api development with rails
Api development with railsApi development with rails
Api development with rails
 
Sap
SapSap
Sap
 
Openshift Container Platform: First ItalyMeetup
Openshift Container Platform: First ItalyMeetupOpenshift Container Platform: First ItalyMeetup
Openshift Container Platform: First ItalyMeetup
 
apidays LIVE New York - API Code First vs Design First by Phil Sturgeon
apidays LIVE New York - API Code First vs Design First by Phil Sturgeonapidays LIVE New York - API Code First vs Design First by Phil Sturgeon
apidays LIVE New York - API Code First vs Design First by Phil Sturgeon
 
What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer tools
 
apidays LIVE Paris - Bring the API culture to DevOps teams by Christophe Bour...
apidays LIVE Paris - Bring the API culture to DevOps teams by Christophe Bour...apidays LIVE Paris - Bring the API culture to DevOps teams by Christophe Bour...
apidays LIVE Paris - Bring the API culture to DevOps teams by Christophe Bour...
 
Serverless in Swift like a Breeze
Serverless in Swift like a BreezeServerless in Swift like a Breeze
Serverless in Swift like a Breeze
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
 
Sap index
Sap indexSap index
Sap index
 
SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01
 
Open api in enterprise
Open api in enterpriseOpen api in enterprise
Open api in enterprise
 
OSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
OSCamp #4 on Foreman | CLI tools with Foreman by Martin BačovskýOSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
OSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John Hardy
 
Usda ocio-its itsm7-integration_architecturediagram_v1_100109
Usda ocio-its itsm7-integration_architecturediagram_v1_100109Usda ocio-its itsm7-integration_architecturediagram_v1_100109
Usda ocio-its itsm7-integration_architecturediagram_v1_100109
 
Costruire applicazioni multi-tenant e piattaforme SaaS in PHP con Innomatic
Costruire applicazioni multi-tenant e piattaforme SaaS in PHP con InnomaticCostruire applicazioni multi-tenant e piattaforme SaaS in PHP con Innomatic
Costruire applicazioni multi-tenant e piattaforme SaaS in PHP con Innomatic
 
R2D2- Personal assistant on android.
R2D2- Personal assistant on android.R2D2- Personal assistant on android.
R2D2- Personal assistant on android.
 

TABS APIs

  • 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
  • 6. Logical structure of APIsLogical structure of APIs
  • 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
  • 10. OrdersOrders  apiord [-d[123456789] -e -n -t -c] O SOTYPEapiord [-d[123456789] -e -n -t -c] O SOTYPE [Subno] [User] [Promotion|NULL][Subno] [User] [Promotion|NULL] [ServiceDetail|NULL] [SUBSIDY_FLAG][ServiceDetail|NULL] [SUBSIDY_FLAG] [SendSwitchCMD:Y|N][SendSwitchCMD:Y|N] ServiceDetail: [I|D,EQUIPID,LoginId|NULL,SerialNo|NULL]....ServiceDetail: [I|D,EQUIPID,LoginId|NULL,SerialNo|NULL].... EX: I,ACCESS,NULL,NULL+D,CLIP|...EX: I,ACCESS,NULL,NULL+D,CLIP|... [SUBSIDY_FLAG:Y|N] [SendSwitchCMD:Y|N ][SUBSIDY_FLAG:Y|N] [SendSwitchCMD:Y|N ]
  • 11. PaymentPayment  apiord [-d[123456789] -e -n -t -c] P [PayAgainst] [Subno|Contrno,Amount]apiord [-d[123456789] -e -n -t -c] P [PayAgainst] [Subno|Contrno,Amount] [Username] [Paymode] [ChqDetails|NULL] [CardDetails|NULL] [EquipDetails|[Username] [Paymode] [ChqDetails|NULL] [CardDetails|NULL] [EquipDetails| NULL] [InvDetails|NULL] [AdvDetails|NULL] [CheckSubscriber] [Currency]NULL] [InvDetails|NULL] [AdvDetails|NULL] [CheckSubscriber] [Currency] [Payment_For] [Pay_Future_invocies] [L_sIsDepositRefund][Payment_For] [Pay_Future_invocies] [L_sIsDepositRefund] [L_sIsAdvancePayContrno][L_sIsAdvancePayContrno]  PayAgainst: [S|C]PayAgainst: [S|C]  ChqDetails[Bank_code, Bank_branch,Cheque_number,Bank_account_id,ExpDate] andChqDetails[Bank_code, Bank_branch,Cheque_number,Bank_account_id,ExpDate] and  ExpDate:DDMMYYYYExpDate:DDMMYYYY  CardDetails:[CardNo,IssUser, ExpDate,VerifNo] and ExpDate:MMYYYYCardDetails:[CardNo,IssUser, ExpDate,VerifNo] and ExpDate:MMYYYY  EquipDetails:[Subno,EquipId,Amount]EquipDetails:[Subno,EquipId,Amount]  InvDetails: [InvoiceNo,amount]InvDetails: [InvoiceNo,amount]  AdvancePayment: [Subno,SubscrType,Area,Amount]AdvancePayment: [Subno,SubscrType,Area,Amount]  CheckSubscriber: '[Y|N]CheckSubscriber: '[Y|N]  Currency like SARCurrency like SAR  Payment_For:DEP|INV|NON|NULLPayment_For:DEP|INV|NON|NULL  Pay_Future_invocies:Y|NPay_Future_invocies:Y|N  L_sIsDepositRefund:Y|NL_sIsDepositRefund:Y|N  L_sIsAdvancePayContrno:Y|NL_sIsAdvancePayContrno:Y|N
  • 12. Cash SalesCash Sales  apiord [-d[123456789] -e -n -t -c] C [Contrno] [Subno|NULL]apiord [-d[123456789] -e -n -t -c] C [Contrno] [Subno|NULL] [Amount] [Contact Number|NULL] [EquipDetails|NULL][Amount] [Contact Number|NULL] [EquipDetails|NULL] [Username] [Paymode] [PayDate:YYYY-MM-DD] [CardDetails|[Username] [Paymode] [PayDate:YYYY-MM-DD] [CardDetails| NULL] [ChqDetails|NULL] [Note|NULL] [Rc_name|NULL]NULL] [ChqDetails|NULL] [Note|NULL] [Rc_name|NULL] [DiscountDetail] [CheckPrice] [Currency][DiscountDetail] [CheckPrice] [Currency]  CardDetails:[CardNo,IssUser,ExpDate(YYYYMMDD),VerifNo]CardDetails:[CardNo,IssUser,ExpDate(YYYYMMDD),VerifNo]  ChqDetails[Bank_code, Bank_branch,Cheque_number]ChqDetails[Bank_code, Bank_branch,Cheque_number]  EquipDetails:EquipDetails: [EquipId,Amt,Amt_int,Qty,Frm_serial,To_Serial,SubsidySubNo,Subsidy[EquipId,Amt,Amt_int,Qty,Frm_serial,To_Serial,SubsidySubNo,Subsidy Area,SubsidySubtype]Area,SubsidySubtype]  DiscountDetail:[DiscountAmount,DiscountPercent]DiscountDetail:[DiscountAmount,DiscountPercent]  CheckPrice: '[Y|N]CheckPrice: '[Y|N]  Currency Like SARCurrency Like SAR
  • 13. Issue Manual InvoiceIssue Manual Invoice  apiord [-d[123456789] -e -n -t -c] I 01 [contrno]apiord [-d[123456789] -e -n -t -c] I 01 [contrno] [subno] [area] [subscr_type] [amount] [vat_amt][subno] [area] [subscr_type] [amount] [vat_amt] [user_name][user_name]
  • 14. Pre-Paid To Post-Paid MigrationPre-Paid To Post-Paid Migration  apiord [-d[123456789] -e -n -t -c] I 02 [contrno]apiord [-d[123456789] -e -n -t -c] I 02 [contrno] [subno] [cardno] [transno] [transdate (DD-[subno] [cardno] [transno] [transdate (DD- MON-YYYY)] [substatus] [balance] [ar_ref]MON-YYYY)] [substatus] [balance] [ar_ref] [transstatus] [error_code] [error_msg] [logname][transstatus] [error_code] [error_msg] [logname] [logdate (DD-MON-YYYY)] [processed_by][logdate (DD-MON-YYYY)] [processed_by]
  • 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”