Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Triniti Api Reference
The API is organized around REST. Our API has predictable resource-oriented URLs, accepts json-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
The API key you use to authenticate the request determines whether the request is live mode or test mode.
Authentication
The Triniti API uses API keys to authenticate requests. You can view and manage your API keys in the triniti.properties file in xxx
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
You need to provide two headers X-Api-Key and X-Api-Secret. This pair of headers acts as the credentials.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Versioning
When we make backwards-incompatible changes to the API, we release new, dated versions. The current version is 2.0. Read our API upgrades guide to see our API changelog and to learn more about backwards compatibility.
All requests will use your account API settings, unless you override the API version. The changelog lists every available version. Note that events generated by API requests will always be structured according to your account API version.
You can visit your Dashboard to upgrade your API version. As a precaution, use API versioning to test a new API version before committing to an upgrade.
Analyse the provided text using triniti v2 API engine.
Body parameter
{"input":"I want to send to Amol","previous-inputs":["I want to transfer 50 rs"],"prompt":"who do you want to transfer to?","current-intent":"txn-moneymovement","expected-entities":["banking.payee_name","sys.amount","banking.from_account"],"triniti-state-context":"","client-state-context":{"user":"a","txn":124345},"options":["similar","fragment","compression","debug","semantics","discourse","expansion"]}
Parameters
Parameter
In
Type
Required
Description
X-Api-Key
header
string
true
Api key of the workspace that you want to analyse
X-Api-Secret
header
string
true
Api Secret of the workspace
X-User-Id
header
string
true
User-ID that you want to associate the request with
X-Session-Id
header
string
true
Session-ID to associate the context of the logged in user.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
{"input":"I want to send to Amol","previous-inputs":["I want to transfer 50 rs"],"prompt":"who do you want to transfer to?","current-intent":"txn-moneymovement","expected-entities":["banking.payee_name","sys.amount","banking.from_account"],"triniti-state-context":"","client-state-context":{"user":"a","txn":124345},"options":["similar","fragment","compression","debug","semantics","discourse","expansion"]}
Properties
Name
Type
Required
Restrictions
Description
input
string
true
none
Input query string in natural language as specified by the user
previous-inputs
[string]
false
none
Previous input stringd in the same session.
prompt
string
false
none
The query that was posted to the user before he queried
current-intent
string
false
none
The current intent of the transaction. if any
expected-entities
[string]
false
none
none
triniti-state-context
string
true
none
none
client-state-context
string
true
none
Serialized string which will be returned back after processing
This provides the Triniti Version that is processing this request. Triniti upgrades within a major release 2.X.X are backward compatible for response structure.
client-state-context
string
false
none
This simply returns the Client-State-Context passed in the process request parameters. This is usually used when calling application does not want to maintain state or have implemented someone sort of call back.
Queries section will have upto 2 queries in case user provides a compound sentence. This “Query” show the first/second query.
expanded
string
false
none
This is the contextually expanded query that is used for further processing.
expansion-confidence
integer
false
none
Not Implemented
adversity
integer
false
none
This returns the probability of the query being invalid or out of domain that the classifier has been trained for. Anything above 0.5 is to be considered as an adversarial input.
emotion
string
false
none
This returns if the emotion of the input is “positive” or “Negative”
emotion-score
integer
false
none
This return the emotion score on scale of 0.0 - 1.0. 0.0 being extremely negative and 1.0 being extremely positive
subject-of-emotion
string
false
none
This return the subject of emotion if available based on users input. This is typically the noun phrases such as “card”, “service” etc.
This is returned by triniti at times to remember the state of the conversation. This value must be passed back on the subsequent call of triniti for that user session.
Returns “information” for inputs that are informative in nature. “instruction” for queries, transactions. This may be ignored if the input is smalltalk.
response-type
string
false
none
none
response-grain
string
false
none
none
event-tense
string
false
none
Returns “past” or “present” denoting the tense of the user input
semantic-parse
string
false
none
none
Intent
{"name":"string","confidence":0}
Properties
Name
Type
Required
Restrictions
Description
name
string
false
none
none
confidence
integer
false
none
none
Fragment
{"expansion":"string"}
Properties
Name
Type
Required
Restrictions
Description
expansion
string
false
none
Provides upto 3 expansion options to make the users input complete and classifiable. This can be presented to the user if needed to let them make the choice on how their input should be interpreted.
This contains debug information, that can communicate errors, exceptions and other information that can be useful to debug and behaviour from triniti.
Properties
Name
Type
Required
Restrictions
Description
faq-subtopic
string
false
none
none
faq-subtopic-confidence
integer
false
none
none
faq-topic
string
false
none
none
faq-topic-confidence
integer
false
none
none
faq-products
string
false
none
none
faq-candidates
string
false
none
none
Morfeus API
About
The Morfeus API is a RESTful HTTP interface that enables receiving and responding to chat conversations from various interfaces. Morfeus API allows access to a fully integrated system which combines the power of Triniti as the AI engine and obfuscates various system configuration.
The primary audience for this API is front end channel interfaces and other peer systems and can only respond to end-user initiated conversations in the context of a specific channel configured in Morfeus system.
This documentation currently limits to the usage of Morfeus API with Web clients.
Getting Started
A bot and its channels must be provisioned first in Morfeus to use the chat API. To provision, a WEB bot should be created in Morfeus. You would receive a bot channel id, and that would form the basis of all API’s. The bot id essentially is an alpha numeric string for example - 12w234jgfs and the API’s generally look like this -
If parent or wrapper application already has user login session, morfeus can reuse that session, by initializing the SDK with an m-auth header. m-auth is a JSON object with existing session details serialize as String, which server will validate to create chatbot login session.
POST https://{domain}/morfeus/v1/channels/{botChannelId}/init
The /authMessage API allows a client to send a user-typed message to Morfeus. This API is synchronous, and the clients are expected to wait for the response from the server. The response from the server would state if the response has to be rendered via text message or a UI template like cards, list, button, etc.
This API has additional requirement of passing CSRF tokens once a user does a login using the Login API. Post login every call to /authMessage is responded with a new X-XSRF-TOKEN. The new token now has to pass to the next immediate subsequent call to /authMessage. Hence the X-XSRF-TOKEN is both a request and a response header.
POST https://{domain}/morfeus/v1/channels/{botChannelId}/authMessage
The /message API allows a client to send a user-typed message to Morfeus. This API supports both synchronous and asynchronus. The response from the server would state if the response has to be rendered via text message or a UI template like cards, list, button, etc. and will be used only for social channels
POST https://{domain}/morfeus/v1/channels/{botChannelId}/message
This layout displays an Image Card layout with a swipe through Carousel effect.
Carousel card can determine if message’s content property contains more than one JSON Object and if the templateType is not ListCardTemplate then given a list of the element would be used to generate individual template and each generated template would get displayed in the horizontal list as shown in below image.
Users can interact with the bot by either typing or clicking on the call to actions (button). In both the cases /authMessage API is to be called with "messageType" as "text" for text messages and "postback" for the button clicks.
For each button element, there are two properties payload and action, to act on click of the button.
If the action type is postback, then the client has to send an associated payload to the server in post request body via authMessage API call.
Many templates support button UI component.
Parameter details for Postback action
Parameter
Description
userId
Unique user Id
messageContent
payload associated with button sent in the previous response.
Webview sends back data to SDK or Application as type “webviewMessage”.
messages
Messages object of JSON contains multiple message objects.Each message represents one of the card template supported by Morfeus Server
headers
MORFEUSSESSIONID
This property need to be set as part of cookie, for next request.
applicationId
This property need to be set as part of cookie, for next request.
X-CSRF-Token
The CSRF token which was part of the response of previous /authMessage API call. A mismatch of this token will invalidate the server session of a user, and will be treated as an CSRF attempt
IVR
For request and response of IVR look at the Swagger file.
Morfeus Admin API
The Morfeus Admin API's are RESTful HTTP interfaces that expose some of the Morfeus Admin functionality.
Get Token
POST /morfeusadmin/api/login/authenticate/jwt
Code Samples
curl -X POST https://morfeusadmin.active.ai/morfeusadmin/api/login/authenticate/jwt \
-H 'Content-Type : application/json'\
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
The endpoint is used to process the natural language in the form of text. The response contains structured information which can be used to perform appropriate actions.
curl --location --request GET 'http://localhost:8080/morfeusadmin/api/triniti/servicereq/modify?botIntId=122&doEncrypt=true'\
--header 'api-key: 9e0dc6e6-fd4e-4bb0-34rf-989d1be74a52'
Encrypt/decrypt Transaction records
API Sample
curl --location --request GET 'http://localhost:8080/morfeusadmin/api/triniti/transaction/modify?botIntId=122&doEncrypt=true'\
--header 'api-key: 343fdf3-fd4e-4bb0-14r4-63341be74aa4'
Parameters
Parameter
Type
Required
Description
botIntId
integer
true
bot_int_id
doEncrypt
boolean
true
If true encrypt records, if false decrypt the records
Morfeus Partner API's
The Morfeus Admin API's is a RESTful HTTP interface for partner systems who want to integrate into the Moprfeus Platform. These API's are stateless and rely on authenticatio tokens.
Sequence Flow
On bot initialization, bot channel would invoke partner server. Partner server needs to have a mechanism to handle anonymous users in case of the web channel. Call morfeus /message endpoint with type as 'init.' Morfeus would return a welcome message, which partner server needs to transform based on the channel and respond to the bot channel.
For any messages which don't require login session, the partner would forward the request to morfeus and morfeus would return a message appropriately, which partner server needs to transform based on the channel and respond to the bot channel.
Morfeus would return with a flag and a token to initiate login flow where it identifies login session is required.
The partner would initiate login flow as per their standard. The partner would call the morfeus /authlogin endpoint with token and customer ID after the successful login. Based on the information retrieved from the token, morfeus would create a login session for the user and proceed with the flow. Morfeus would send updated ID in the response If the user were enrolled earlier with a different user ID. For the rest of the subsequent calls, the partner needs to send the same user ID in the request body.
Bot Management
Bot Creation
Sequence Flow for Bot Creation
Call Token API to get the JWT token to call the Bot Management APIs.
Call create Bot API, with all the required and optional parameters. If the domain is Banking, it will load all the default config for the banking domain, and load data API (Git Sync) is mandatory in that case.
Call Token API again with bot code received from the create Bot API. Use refreshed token for further API calls.
If the bot is of the Banking domain, call the Load Data API. Load Data API might take a long time; hence, a progress ID is returned to check the progress of loading the data in the system. Using that progress ID client to call the Progress API to check the progress.
FAQs data is to be loaded using the FAQ import data API in a JSON format. Like Load Data API this also returns the progress ID to check the progress. The client can call Load Data API and FAQ import data parallelly.
Once Load Data API and FAQ import data API are completed, the client needs to call the Train API. Also, like Load Data API and FAQ import data API, this API returns progress ID to check the progress.
Call create instance API.
Retail Banking Domain API's
These Retail Bankign REST APIs mirror the business domain objects for Retail Banking . The Active AI Platform Retail Banking Conversational business apps are pre intergated to this API construct. Developers can implement these API's in a langiage of their choice and can integrate onwards to an API gateway or a Core Banking gateway. For a reference implementation using Spring boot pls check the resources section < link >.
Login
Customer Profile
Accounts
Cards
Account Transactions
Card Transtions
Fund Transfer
Bill Payment
The Virtual Assistant is already integrated with these endpoints, hence just fork it, customise it, deploy it to get your virtual assistant to work with your respective core systems.
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/customers/profile/{customerId}");/* API call to get customer details */@RequestMapping(value="/customers/profile/{customerId}",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<CustomerProfileResponse>getCustomerProfile(@PathVariable("customerId")StringcustomerId){ApplicationLogger.logInfo("Entering CustomerProfile Controller");/* End of API call *//* Bank API integration to get customer details */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CUSTOMER_PROFILE_API_END_POINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Customer Profile Response Body Before Transformation :"+response.getBody());StringcustomerProfileResponseString=customerProfileResponseMapper.getManipulatedCustomerProfileResponse(response.getBody());ApplicationLogger.logInfo("Customer Profile Response Body After Transformation :"+response.getBody());customerProfileResponse=objectMapper.readValue(customerProfileResponseString,CustomerProfileResponse.class);}returnResponseEntity.ok(customerProfileResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/customers/profile/{customerId}/email");/* API call for updating customer email address */@RequestMapping(value="/customers/profile/{customerId}/email",produces={"application/json"},method=RequestMethod.PUT)publicResponseEntity<CustomerProfileResponse>updateCustomerProfileEmail(@PathVariable("customerId")StringcustomerId,@RequestBodyfinalCustomerProfileRequestcustomerProfileRequest){ApplicationLogger.logInfo("Entering CustomerProfile Controller");/* End of API call *//* Bank API integration to update customer email address */HttpResponse<String>response=Unirest.put(propertyUtil.getAPIUrl(PropertyConstants.UPDATE_EMAIL_API_END_POINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Customer Profile Response Body Before Transformation :"+response.getBody());StringcustomerProfileResponseString=customerProfileResponseMapper.getManipulatedCustomerProfileResponse(response.getBody());ApplicationLogger.logInfo("Customer Profile Response Body After Transformation :"+response.getBody());customerProfileResponse=objectMapper.readValue(customerProfileResponseString,CustomerProfileResponse.class);}returnResponseEntity.ok(customerProfileResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/customers/profile/{customerId}/phoneNo");/* API to update customer phone number */@RequestMapping(value="/customers/profile/{customerId}/phoneNo",produces={"application/json"},method=RequestMethod.PUT)publicResponseEntity<CustomerProfileResponse>updateCustomerProfilePhone(@PathVariable("customerId")StringcustomerId,@RequestBodyfinalCustomerProfileRequestcustomerProfileRequest){ApplicationLogger.logInfo("Entering CustomerProfile Controller");/* End of API call *//* Bank integration to update phone number */HttpResponse<String>response=Unirest.put(propertyUtil.getAPIUrl(PropertyConstants.UPDATE_PHONE_API_END_POINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Customer Profile Response Body Before Transformation :"+response.getBody());StringcustomerProfileResponseString=customerProfileResponseMapper.getManipulatedCustomerProfileResponse(response.getBody());ApplicationLogger.logInfo("Customer Profile Response Body After Transformation :"+response.getBody());customerProfileResponse=objectMapper.readValue(customerProfileResponseString,CustomerProfileResponse.class);}returnResponseEntity.ok(customerProfileResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/customers/profile/{customerId}/address");/* API to update customer phone number */@RequestMapping(value="/customers/profile/{customerId}/address",produces={"application/json"},method=RequestMethod.PUT)publicResponseEntity<CustomerProfileResponse>updateCustomerProfileAddress(@PathVariable("customerId")StringcustomerId,@RequestBodyfinalCustomerProfileRequestcustomerProfileRequest){ApplicationLogger.logInfo("Entering CustomerProfile Controller");/* End of API call *//* Bank integration to update phone number */HttpResponse<String>response=Unirest.put(propertyUtil.getAPIUrl(PropertyConstants.UPDATE_ADDRESS_API_END_POINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Customer Profile Response Body Before Transformation :"+response.getBody());StringcustomerProfileResponseString=customerProfileResponseMapper.getManipulatedCustomerProfileResponse(response.getBody());ApplicationLogger.logInfo("Customer Profile Response Body After Transformation :"+response.getBody());customerProfileResponse=objectMapper.readValue(customerProfileResponseString,CustomerProfileResponse.class);}returnResponseEntity.ok(customerProfileResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/casa");/* API to get all current and savings account */@ApiOperation(value="Returns list of casa accounts based on customer ID")@RequestMapping(value="/{customerId}/accounts/casa",produces{"application/json"},method=RequestMethod.GET)publicResponseEntity<AccountsResponse>getCasaAccounts(@PathVariable(name="customerId",required=true)StringcustomerId){ApplicationLogger.logInfo("Entering getCasaAccountsResponseEntity API");/* End of API call *//* Bank integration to get all current and savings account */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CASA_ACCOUNT_API_END_POINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("Casa API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo(" Casa Response Body Before Transformation :"+response.getBody());StringaccountsResponseString=accountsResponseMapper.getManipulatedAccountsResponse(response.getBody());ApplicationLogger.logInfo("Casa Response Body After Transformation :"+response.getBody());accountsResponse=objectMapper.readValue(accountsResponseString,AccountsResponse.class);}returnResponseEntity.ok(accountsResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/casa/{accountId}");/* API to get current and savings account details */@ApiOperation(value="Returns selected casa account details")@RequestMapping(value="/{customerId}/accounts/casa/{accountId}",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<AccountDetailResponse>getCasaAccountDetail(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="accountId",required=true)StringaccountId){ApplicationLogger.logInfo("Entering getCasaAccountDetail API");/* End of API call *//* Bank integration to get current and savings account details */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CASA_ACCOUNT_DETAILS_API_END_POINT,customerId,accountId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Casa Account Details Response Body Before Transformation :"+response.getBody());StringaccountDetailResponseString=accountsResponseMapper.getManipulatedAccountDetailsResponse(response.getBody());ApplicationLogger.logInfo("Casa Account Details Response Body After Transformation :"+response.getBody());accountDetailsResponse=objectMapper.readValue(accountDetailResponseString,AccountDetailResponse.class);}returnResponseEntity.ok(accountDetailsResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/casa/{accountId}/balance");/* API to get current and savings account balance */@ApiOperation(value="Returns selected casa account balance")@RequestMapping(value="/{customerId}/accounts/casa/{accountId}/balance",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<AccountBalanceResponse>getCasaAccountBalance(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="accountId",required=true)StringaccountId){ApplicationLogger.logInfo("Entering getCasaAccountBalance API");/* End of API call *//* Bank integration to get current and savings account balance */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CASA_ACCOUNT_BALANCE_API_END_POINT,customerId,accountId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Casa Account Balance Response Body Before Transformation :"+response.getBody());StringaccountDetailResponseString=accountsResponseMapper.getManipulatedAccountsBalanceResponse(response.getBody());ApplicationLogger.logInfo("Casa Account Balance Response Body After Transformation :"+response.getBody());accountBalanceResponse=objectMapper.readValue(accountDetailResponseString,AccountBalanceResponse.class);}returnResponseEntity.ok(accountBalanceResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/{accountId}/transactions");/* API to get current and savings account transactions */@ApiOperation(value="Returns selected casa account transaction history")@RequestMapping(value="/{customerId}/accounts/{accountId}/transactions",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<AccountTransactionsResponse>getCasaAccountTransactions(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="accountId",required=true)StringaccountId){ApplicationLogger.logInfo("Entering getCasaAccountTransactions API");/* End of API call *//* Bank integration to get current and savings account transactions */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CASA_ACCOUNT_TRANSACTIONS_HISTORY_API_END_POINT,customerId,accountId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Account Transactions Response Body Before Transformation :"+response.getBody());StringaccountTransactionsResponseString=accountsResponseMapper.getManipulatedAccountTransactionsResponse(response.getBody());ApplicationLogger.logInfo("Account Transactions Response Body After Transformation :"+response.getBody());accountTransactionsResponse=objectMapper.readValue(accountTransactionsResponseString,AccountTransactionsResponse.class);}returnResponseEntity.ok(accountTransactionsResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/chequebook/order/confirm");/* API to get confirmation of ordered cheque book */@ApiOperation(value="Returns confirmation of order cheque book")@RequestMapping(value="/{customerId}/chequebook/order/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<ChequeBookOrderConfirmResponse>confirmChequeBookOrder(@PathVariable(value="customerId",required=true)StringcustomerId,@RequestBodyfinalChequeBookOrderConfirmRequestchequeBookConfirmRequest){ApplicationLogger.logInfo("Entering getconfirmChequeBookOrder API");/* End of API call *//* Bank integration to get confirmation of ordered cheque book */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CHEQUE_BOOK_ORDER_CONFIRM_API_ENDPOINT,chequeBookOrderConfirmRequest.getCustomerId(),chequeBookOrderConfirmRequest.getAccount().getAccountNumber())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Credit Card Limit Confirm Response Body Before Transformation :"+response.getBody());StringchequeBookOrderConfirmResponseString=accountsResponseMapper.getManipulatedAccountsResponse(response.getBody());ApplicationLogger.logInfo("Credit Card Limit Confirm Response Body After Transformation :"+response.getBody());chequeBookOrderConfirmResponse=objectMapper.readValue(chequeBookOrderConfirmResponseString,ChequeBookOrderConfirmResponse.class);}returnnewResponseEntity<>(chequeBookOrderConfirmResponse,HttpStatus.valueOf(response.getStatus()));
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/creditcards");/*API call for Credit Cards List*/@ApiOperation(value="Returns list of credit cards based on customer ID")@RequestMapping(value="/{customerId}/cards/creditcards",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<CardsResponse>getCreditCards(@PathVariable(value="customerId",required=true)StringcustomerId){logger.info("Entering getCreditCards");/*End of API Call*//*Bank API Integration for Credit Cards List*/HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CREDIT_CARDS_API_END_POINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Credit Cards Response Body Before Transformation :"+response.getBody());StringcardsResponseString=cardsResponseMapper.getManipulatedCardsResponse(response.getBody());ApplicationLogger.logInfo("Credit Cards Response Body After Transformation :"+response.getBody());cardsResponse=objectMapper.readValue(cardsResponseString,CardsResponse.class);}returnnewResponseEntity<>(cardsResponse,HttpStatus.valueOf(response.getStatus()));/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/debitcards");/*API Call for Debit Cards List*/@ApiOperation(value="Returns list of debit cards based on customer ID")@RequestMapping(value="/{customerId}/cards/debitcards",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<CardsResponse>getDebitCards(@PathVariable(value="customerId",required=true)StringcustomerId){logger.info("Entering getDebitCards");/*End of API call*//*Bank API Integration for Debit Cards List*/HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.DEBIT_CARDS_API_END_POINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Debit Cards Response Body Before Transformation :"+response.getBody());StringcardsResponseString=cardsResponseMapper.getManipulatedCardsResponse(response.getBody());ApplicationLogger.logInfo("Debit Cards Response Body After Transformation :"+response.getBody());cardsResponse=objectMapper.readValue(cardsResponseString,CardsResponse.class);}returnnewResponseEntity<>(cardsResponse,HttpStatus.valueOf(response.getStatus()));/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/creditcards/{cardNumber}");/* API call for CreditCard Details*/H@ApiOperation(value="Returns selected credit card details")@RequestMapping(value="/{customerId}/cards/creditcards/{cardNumber}",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<CardDetailResponse>getCreditCardDetails(@PathVariable(value="customerId",required=true)StringcustomerId,@PathVariable(value="cardNumber",required=true)StringcardNumber){logger.info("Entering getCreditCardDetails");/*End of API Call*//*Bank API Integration of Credit Card Details*/HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CREDIT_CARD_DETAILS_API_END_POINT,customerId,cardNumber)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Credit Card Details Response Body Before Transformation :"+response.getBody());StringcardDetailsResponseString=cardsResponseMapper.getManipulatedCardDetailsResponse(response.getBody());ApplicationLogger.logInfo("Credit Card Details Response Body After Transformation :"+response.getBody());cardDetailResponse=objectMapper.readValue(cardDetailsResponseString,CardDetailResponse.class);}returnResponseEntity.ok(cardDetailResponse);/*End on Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/debitcards/{cardNumber}");/*API call for DebitCard Details*/@ApiOperation(value="Returns selected debit card details")@RequestMapping(value="/{customerId}/cards/debitcards/{cardNumber}",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<CardDetailResponse>getDebitCardDetails(@PathVariable(value="customerId",required=true)StringcustomerId,@PathVariable(value="cardNumber",required=true)StringcardNumber){logger.info("Entering getDebitCardDetails");/*End of API Call*//*Bank API Integration for Debit Cards Details*/HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.DEBIT_CARD_DETAILS_API_END_POINT,customerId,cardNumber)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Debit Card Details Response Body Before Transformation :"+response.getBody());StringcardDetailsResponseString=cardsResponseMapper.getManipulatedCardDetailsResponse(response.getBody());ApplicationLogger.logInfo("Debit Card Details Response Body After Transformation :"+response.getBody());cardDetailResponse=objectMapper.readValue(cardDetailsResponseString,CardDetailResponse.class);}returnResponseEntity.ok(cardDetailResponse);/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/{cardId}/block/confirm");/*API CALL for Block Card*/@ApiOperation("Return blocking status of selected card")@RequestMapping(value="/{customerId}/cards/{cardNumber}/block/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<BlockCardResponse>blockCard(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="cardNumber",required=true)StringcardNumber,@RequestBodyfinalBlockCardRequestblockCardRequest){ApplicationLogger.logInfo("Entering getBlockStatus API");/*End of API Call*//*Bank API Integration for Block Card*/HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrlForBlockCard(PropertyConstants.BLOCK_CARD_DETAILS_API_END_POINT,blockCardRequest)).header("Content-Type","application/json").body(objectMapper.writeValueAsString(blockCardRequest)).asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Block Card Response Body Before Transformation :"+response.getBody());StringblockCardResponseString=blockCardResponseMapper.getManipulatedBlockCardResponse(response.getBody());ApplicationLogger.logInfo("Block Card Response Body After Transformation :"+response.getBody());blockCardResponse=objectMapper.readValue(blockCardResponseString,BlockCardResponse.class);}returnResponseEntity.ok(blockCardResponse);/*End of API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/{cardId}/activation/confirm");/*API CALL for Activate Card*/@ApiOperation("Return activation status of selected card")@RequestMapping(value="/{customerId}/cards/{cardNumber}/activation/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<ActivationCardResponse>activationCard(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="cardNumber",required=true)StringcardNumber,@RequestBodyfinalActivationCardRequestactivationCardRequest){ApplicationLogger.logInfo("Entering getActivationStatus API");/*End of API Call*//*Bank API Integration for Activation Card*/HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrlForActivateCard(PropertyConstants.ACTIVATE_CARD_DETAILS_API_END_POINT,activationCardRequest)).header("Content-Type","application/json").body(objectMapper.writeValueAsString(activationCardRequest)).asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Activation Card Response Body Before Transformation :"+response.getBody());StringactivationCardResponseString=activationCardResponseMapper.getManipulatedActivationCardResponse(response.getBody());ApplicationLogger.logInfo("Activation Card Response Body After Transformation :"+response.getBody());activationCardResponse=objectMapper.readValue(activationCardResponseString,ActivationCardResponse.class);}returnResponseEntity.ok(activationCardResponse);/*End of API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/creditcards/{cardNumber}/getLimits");/*API CAll for Credit Card Limits*/@ApiOperation(value="Returns credit card limit")@RequestMapping(value="/{customerId}/creditcards/{cardNumber}/getLimits",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<CreditCardLimitResponse>getCreditCardLimits(@PathVariable(value="customerId",required=true)StringcustomerId,@PathVariable(value="cardNumber",required=true)StringcardNumber){logger.info("Entering getCreditLimitResponse");/*End of API Call*//*Bank API Integration for CreditCard Limits*/HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CREDIT_CARD_LIMIT_API_END_POINT,customerId,cardNumber)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Credit Card Limit Response Body Before Transformation :"+response.getBody());StringcreditCardLimitResponseString=creditCardResponseMapper.getManipulatedCreditCardLimitResponse(response.getBody());ApplicationLogger.logInfo("Credit Card Limit Response Body After Transformation :"+response.getBody());creditCardLimitResponse=objectMapper.readValue(creditCardLimitResponseString,CreditCardLimitResponse.class);}returnResponseEntity.ok(creditCardLimitResponse);/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/debitcards/{cardNumber}/getLimits");/*API CAll for Debit Card Limits*/@ApiOperation(value="Returns debit card limit")@RequestMapping(value="/{customerId}/cards/debitcards/{cardNumber}/getLimits",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<DebitCardLimitResponse>getDebitCardLimits(@PathVariable(value="customerId",required=true)StringcustomerId,@PathVariable(value="cardNumber",required=true)StringcardNumber){logger.info("Entering getDebitLimitResponse");/*End of API Call*//*Bank API Integration for DebitCard Limits*/HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.DEBIT_CARD_LIMIT_API_END_POINT,customerId,cardNumber)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Debit Card Limit Response Body Before Transformation :"+response.getBody());StringdebitCardLimitResponseString=debitCardResponseMapper.getManipulatedDebitCardLimitResponse(response.getBody());ApplicationLogger.logInfo("Debit Card Limit Response Body After Transformation :"+response.getBody());debitCardLimitResponse=objectMapper.readValue(debitCardLimitResponseString,DebitCardLimitResponse.class);}returnResponseEntity.ok(debitCardLimitResponse);/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/creditcards/limit/confirm");/*API Call for Credit Limit Update*/@ApiOperation(value="Returns confirmation of credit card limit")@RequestMapping(value="/{customerId}/creditcards/limit/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<CreditCardLimitConfirmResponse>confirmCreditCardLimit(@PathVariable(value="customerId",required=true)StringcustomerId,@RequestBodyfinalCreditCardLimitConfirmRequestcreditCardLimitConfirmRequest){ApplicationLogger.logInfo("Entering getCreditCardLimitConfirm API");/*End of API Call*//*Bank API Integration for Credit Limit Update*/HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CREDIT_CARD_LIMIT_CONFIRM_API_ENDPOINT,creditCardLimitConfirmRequest.getCustomerId(),creditCardLimitConfirmRequest.getCardDetails().getCardNumber())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Credit Card Limit Confirm Response Body Before Transformation :"+response.getBody());StringcreditCardLimitConfirmResponseString=creditCardResponseMapper.getManipulatedCreditCardLimitConfirmResponse(response.getBody());ApplicationLogger.logInfo("Credit Card Limit Confirm Response Body After Transformation :"+response.getBody());creditCardLimitConfirmResponse=objectMapper.readValue(creditCardLimitConfirmResponseString,CreditCardLimitConfirmResponse.class);}returnnewResponseEntity<>(creditCardLimitConfirmResponse,HttpStatus.valueOf(response.getStatus()));/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/debitcards/limit/confirm");/*API Call for Debit Limit Update*/@ApiOperation(value="Returns confirmation of debit card limit")@RequestMapping(value="/{customerId}/debitcards/{cardNumber}/limit/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<DebitCardLimitConfirmResponse>confirmDebitCardLimit(@PathVariable(value="customerId",required=true)StringcustomerId,@PathVariable(value="cardNumber",required=true)StringcardNumber,@RequestBodyfinalDebitCardLimitConfirmRequestdebitCardLimitConfirmRequest){ApplicationLogger.logInfo("Entering getDebitCardLimitConfirm API");/*End of API Call*//*Bank API Integration for Debit Limit Update*/HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrl(PropertyConstants.DEBIT_CARD_LIMIT_CONFIRM_API_ENDPOINT,debitCardLimitConfirmRequest.getCustomerId(),debitCardLimitConfirmRequest.getCardDetails().getCardNumber())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Debit Card Limit Confirm Response Body Before Transformation :"+response.getBody());StringdebitCardLimitConfirmResponseString=debitCardResponseMapper.getManipulatedDebitCardLimitConfirmResponse(response.getBody());ApplicationLogger.logInfo("Debit Card Limit Confirm Response Body After Transformation :"+response.getBody());debitCardLimitConfirmResponse=objectMapper.readValue(debitCardLimitConfirmResponseString,DebitCardLimitConfirmResponse.class);}returnnewResponseEntity<>(debitCardLimitConfirmResponse,HttpStatus.valueOf(response.getStatus()));/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/{cardId}/internationalUsage/enabled");/*API Call for International Usage Enabled*/@ApiOperation("Return international usage of card is enabled or disabled")@RequestMapping(value="/{customerId}/cards/{cardNumber}/internationalUsage/enabled",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<InternationalUsageResponse>updateInternationalUsage(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="cardNumber",required=true)StringcardNumber,@RequestBodyfinalInternationalCardUsageRequestinternationalCardUsageRequest){ApplicationLogger.logInfo("Entering updateInternationalUsage API");/*End of API Call*//*Bank API Integration for International Usage Enabled*/HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrl(PropertyConstants.INTERNATIONAL_USAGE_ENABLED_API_END_POINT,internationalCardUsageRequest.getCustomerId(),internationalCardUsageRequest.getCardDetails().getCardNumber())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("International Usage API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo(" International Usage Response Body Before Transformation :"+response.getBody());StringdepositPlanResponseString=cardsResponseMapper.getManipulatedInternationalUsageResponse(response.getBody());ApplicationLogger.logInfo("International Usage Response Body After Transformation :"+response.getBody());internationalUsageResponse=objectMapper.readValue(depositPlanResponseString,InternationalUsageResponse.class);}returnResponseEntity.ok(internationalUsageResponse);/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/{cardId}/internationalUsage/api");/*API Call for International Usage Update*/@ApiOperation("Return international usage reference id and status ")@RequestMapping(value="/{customerId}/cards/{cardNumber}/internationalUsage/api",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<InternationalUsageResponse>updateInternationalUsageFinalApiCall(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="cardNumber",required=true)StringcardNumber,@RequestBodyfinalInternationalCardUsageRequestinternationalCardUsageRequest){ApplicationLogger.logInfo("Entering updateInternationalUsage API");/*End of API Call*//*Bank API Integration for International Usage Update*/HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrl(PropertyConstants.INTERNATIONAL_USAGE_API_END_POINT,internationalCardUsageRequest.getCustomerId(),internationalCardUsageRequest.getCardDetails().getCardNumber())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("International Usage API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo(" International Usage Response Body Before Transformation :"+response.getBody());StringdepositPlanResponseString=cardsResponseMapper.getManipulatedInternationalUsageResponse(response.getBody());ApplicationLogger.logInfo("International Usage Response Body After Transformation :"+response.getBody());internationalUsageResponse=objectMapper.readValue(depositPlanResponseString,InternationalUsageResponse.class);}returnResponseEntity.ok(internationalUsageResponse);/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/{cardId}/replaceCard/confirm");/*API CALL for Replace Card*/@ApiOperation("Return status of replacement of card")@RequestMapping(value="/{customerId}/cards/{cardNumber}/replaceCard/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<ReplaceCardConfirmResponse>replaceCard(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="cardNumber",required=true)StringcardNumber,@RequestBodyfinalReplaceCardConfirmRequestreplaceCardConfirmRequest){ApplicationLogger.logInfo("Entering getReplaceCard Confirm API");/*End of API Call*//*Bank API Integration for Replacement of Card*/HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrlForReplaceCard(PropertyConstants.REPLACE_CARD_CONFIRM_API_ENDPOINT,replaceCardConfirmRequest)).header("Content-Type","application/json").body(objectMapper.writeValueAsString(replaceCardConfirmRequest)).asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Replace Card Confirm Response Body Before Transformation :"+response.getBody());StringreplaceCardConfirmResponseString=cardsResponseMapper.getManipulatedReplaceCardConfirmResponse(response.getBody());ApplicationLogger.logInfo("CardNumber :"+response.getBody());replaceCardConfirmResponse=objectMapper.readValue(replaceCardConfirmResponseString,ReplaceCardConfirmResponse.class);}returnnewResponseEntity<>(replaceCardConfirmResponse,HttpStatus.valueOf(response.getStatus()));/*End of API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/{cardId}/resetPin/confirm");/*API CALL for Reset Pin*/@ApiOperation("Return reset pin status of selected card")@RequestMapping(value="/{customerId}/cards/{cardNumber}/resetPin/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<ResetPinConfirmResponse>resetPin(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="cardNumber",required=true)StringcardNumber,@RequestBodyfinalResetPinConfirmRequestresetPinConfirmRequest){ApplicationLogger.logInfo("Entering getResetPin Confirm API");/*End of API Call*//*Bank API Integration for Reset Pin of Card*/HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrlForResetPin(PropertyConstants.RESET_PIN_CONFIRM_API_ENDPOINT,resetPinConfirmRequest)).header("Content-Type","application/json").body(objectMapper.writeValueAsString(resetPinConfirmRequest)).asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Reset Pin Confirm Response Body Before Transformation :"+response.getBody());StringresetPinConfirmResponseString=cardsResponseMapper.getManipulatedResetPinConfirmResponse(response.getBody());ApplicationLogger.logInfo("Reset Pin Confirm Response Body After Transformation :"+response.getBody());resetPinConfirmResponse=objectMapper.readValue(resetPinConfirmResponseString,ResetPinConfirmResponse.class);}returnnewResponseEntity<>(resetPinConfirmResponse,HttpStatus.valueOf(response.getStatus()));/*End of API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/creditcards/{cardNumber}/transactions");/*API Call for Credit Card Transaction*/@ApiOperation(value="Returns selected card transaction history")@RequestMapping(value="/{customerId}/cards/creditcards/{cardNumber}/transactions",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<CardTransactionsResponse>getCreditCardTransactions(@PathVariable(value="customerId",required=true)StringcustomerId,@PathVariable(value="cardNumber",required=true)StringcardNumber){logger.info("Entering getCreditCardTransactions");/*End of API call*//*Bank API Integration for Credit Cards Transaction*/HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.CREDIT_CARD_TRANSACTIONS_HISTORY_API_END_POINT,customerId,accountId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Credit Card Transactions Response Body Before Transformation :"+response.getBody());StringaccountTransactionsResponseString=cardsResponseMapper.getManipulatedCardTransactionsResponse(response.getBody());ApplicationLogger.logInfo("Credit Card Transactions Response Body After Transformation :"+response.getBody());cardTransactionsResponse=objectMapper.readValue(accountTransactionsResponseString,CardTransactionsResponse.class);}returnResponseEntity.ok(cardTransactionsResponse);/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/debitcards/{cardNumber}/transactions");/*API Call for Debit Cards Transactions*/H@ApiOperation(value="Returns selected card transaction history")@RequestMapping(value="/{customerId}/cards/debitcards/{cardNumber}/transactions",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<CardTransactionsResponse>getDebitCardTransactions(@PathVariable(value="customerId",required=true)StringcustomerId,@PathVariable(value="cardNumber",required=true)StringcardNumber){logger.info("Entering getDebitCardTransactions");/*End of API Call*//*Bank API Integration for Debit Cards Transactions*/HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.DEBIT_CARD_TRANSACTIONS_HISTORY_API_END_POINT,customerId,accountId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Credit Card Transactions Response Body Before Transformation :"+response.getBody());StringaccountTransactionsResponseString=cardsResponseMapper.getManipulatedCardTransactionsResponse(response.getBody());ApplicationLogger.logInfo("Credit Card Transactions Response Body After Transformation :"+response.getBody());cardTransactionsResponse=objectMapper.readValue(accountTransactionsResponseString,CardTransactionsResponse.class);}returnResponseEntity.ok(cardTransactionsResponse);/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/creditcards/{cardNumber}/convertEMI");/*API Call for Conversion of CreditCards Transactions to Installments*/@ApiOperation("Return Conversion to EMI from Transaction of Credit card")@RequestMapping(value="/{customerId}/cards/creditcards/{cardNumber}/convertEMI",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<ConvertEMIResponse>convertEMI(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="cardNumber",required=true)StringcardNumber){ApplicationLogger.logInfo("Entering getEMIConversion API");/*End of API Call*//*Bank API Integration for Conversion of CreditCards Transactions to Installments*/try{HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrlForConvertEMI(PropertyConstants.CONVERT_EMI_API_ENDPOINT,customerId,cardNumber)).header("Content-Type","application/json").body(objectMapper.writeValueAsString(convertEMIRequest)).asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Convert EMI Response Body Before Transformation :"+response.getBody());StringconvertEMIResponseString=cardsResponseMapper.getManipulatedConvertEMICreditCardConfirmResponse(response.getBody());ApplicationLogger.logInfo("Convert EMI Response Body After Transformation :"+response.getBody());convertEMIResponse=objectMapper.readValue(convertEMIResponseString,ConvertEMIResponse.class);}returnnewResponseEntity<>(convertEMIResponse,HttpStatus.valueOf(response.getStatus()));/*End of Bank API Integration*/
URLobj=newURL("https://one-api.active.ai/banking-integration/v1/{customerId}/cards/creditcards/{cardNumber}/convertEMI/confirm");/*API Call for Confirmation of Credit Cards Transactions to Installments*/@ApiOperation("Return status of Conversion to EMI from Transaction of Credit card")@RequestMapping(value="/{customerId}/cards/creditcards/{cardNumber}/convertEMI/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<ConvertEMICreditCardConfirmResponse>convertEMICreditCard(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="cardNumber",required=true)StringcardNumber,@RequestBodyfinalConvertEMICreditCardConfirmRequestconvertEMICreditCardConfirmRequest){ApplicationLogger.logInfo("Entering getEMIConversion Confirm API");/*End of API Call*//*Bank API Integration for confirmation of CreditCards Transactions to Installments*/HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrlForConvertEMICreditCardConfirm(PropertyConstants.CONVERT_EMI_CREDIT_CARD_CONFIRM_API_ENDPOINT,convertEMICreditCardConfirmRequest)).header("Content-Type","application/json").body(objectMapper.writeValueAsString(convertEMICreditCardConfirmRequest)).asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Convert EMI Confirm Response Body Before Transformation :"+response.getBody());StringconvertEMICreditCardConfirmResponseString=cardsResponseMapper.getManipulatedConvertEMICreditCardConfirmResponse(response.getBody());ApplicationLogger.logInfo("Convert EMI Confirm Response Body After Transformation :"+response.getBody());convertEMICreditCardConfirmResponse=objectMapper.readValue(convertEMICreditCardConfirmResponseString,ConvertEMICreditCardConfirmResponse.class);}returnnewResponseEntity<>(convertEMICreditCardConfirmResponse,HttpStatus.valueOf(response.getStatus()));/*End of Bank API Integration*/
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/loan");/* API to get loan accounts */@ApiOperation(value="Returns list of loan accounts based on customer ID")@RequestMapping(value="/{customerId}/accounts/loan",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<LoanAccountsResponse>getLoanAccounts(@PathVariable(name="customerId",required=true)StringcustomerId){ApplicationLogger.logInfo("Entering getLoanAccountsResponseEntity API");/* End of API call *//* Bank API to get loan accounts */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.LOAN_ACCOUNT_API_END_POINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("Loan API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo(" Loan Response Body Before Transformation :"+response.getBody());StringaccountsResponseString=accountsResponseMapper.getManipulatedAccountsResponse(response.getBody());ApplicationLogger.logInfo(" Loan Response Body After Transformation :"+response.getBody());loanAccountsResponse=objectMapper.readValue(accountsResponseString,LoanAccountsResponse.class);}returnResponseEntity.ok(loanAccountsResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/loan/{accountId}");/* API to get loan account details */@ApiOperation(value="Returns selected loan account details")@RequestMapping(value="/{customerId}/accounts/loan/{accountId}",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<LoanAccountDetailResponse>getLoanAccountDetail(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="accountId",required=true)StringaccountId){ApplicationLogger.logInfo("Entering getLoanAccountDetail API");/* End of API call *//*Bank integration to get loan account details */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.LOAN_ACCOUNT_DETAILS_API_END_POINT,customerId,accountId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Loan Account Details Response Body Before Transformation :"+response.getBody());StringaccountDetailResponseString=accountsResponseMapper.getManipulatedAccountDetailsResponse(response.getBody());ApplicationLogger.logInfo("Loan Account Details Response Body After Transformation :"+response.getBody());loanAccountDetailResponse=objectMapper.readValue(accountDetailResponseString,LoanAccountDetailResponse.class);}returnResponseEntity.ok(loanAccountDetailResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/loan/{accountId}/balance");/* API to get loan account balance */@ApiOperation(value="Returns selected loan account balance")@RequestMapping(value="/{customerId}/accounts/loan/{accountId}/balance"produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<LoanAccountBalanceResponse>getLoanAccountBalance(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="accountId",required=true)StringaccountId){ApplicationLogger.logInfo("Entering getCasaAccountBalance API");/* End of API call *//*Bank integration to get loan account balance */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.LOAN_ACCOUNT_BALANCE_API_END_POINT,customerId,accountId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Loan Account Balance Response Body Before Transformation :"+response.getBody());StringaccountDetailResponseString=accountsResponseMapper.getManipulatedAccountsBalanceResponse(response.getBody());ApplicationLogger.logInfo("Loan Account Balance Response Body After Transformation :"+response.getBody());loanAccountBalanceResponse=objectMapper.readValue(accountDetailResponseString,LoanAccountBalanceResponse.class);}returnResponseEntity.ok(loanAccountBalanceResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/deposit");/* API to get deposit accounts */@ApiOperation(value="Returns list of deposit accounts based on customer ID")@RequestMapping(value="/{customerId}/accounts/deposit",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<DepositAccountsResponse>getDepositAccounts(@PathVariable(name="customerId",required=true)StringcustomerId){ApplicationLogger.logInfo("Entering getDepositAccountsResponseEntity API");/* End of API call *//* Bank integration to get deposit accounts */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.DEPOSIT_ACCOUNT_API_END_POINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("Deposit API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo(" Deposit Response Body Before Transformation :"+response.getBody());StringaccountsResponseString=accountsResponseMapper.getManipulatedAccountsResponse(response.getBody());ApplicationLogger.logInfo(" Deposit Response Body After Transformation :"+response.getBody());depositAccountsResponse=objectMapper.readValue(accountsResponseString,DepositAccountsResponse.class);}returnResponseEntity.ok(depositAccountsResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/deposit/{accountId}");/* API to get deposit account details */@ApiOperation(value="Returns selected deposit account details")@RequestMapping(value="/{customerId}/accounts/deposit/{accountId}",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<DepositAccountDetailResponse>getDepositAccountDetail(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="accountId",required=true)StringaccountId){ApplicationLogger.logInfo("Entering getDepositAccountDetail API");/* End of API call *//* Bank integration to get deposit account details */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.DEPOSIT_ACCOUNT_DETAILS_API_END_POINT,customerId,accountId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Deposit Account Details Response Body Before Transformation :"+response.getBody());StringaccountDetailResponseString=accountsResponseMapper.getManipulatedAccountDetailsResponse(response.getBody());ApplicationLogger.logInfo("Deposit Account Details Response Body After Transformation :"+response.getBody());depositAccountDetailResponse=objectMapper.readValue(accountDetailResponseString,DepositAccountDetailResponse.class);}returnResponseEntity.ok(depositAccountDetailResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/accounts/deposit/{accountId}/balance");/* API to get deposit account balance */@ApiOperation(value="Returns selected deposit account balance")@RequestMapping(value="/{customerId}/accounts/deposit/{accountId}/balance",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<DepositAccountBalanceResponse>getDepositAccountBalance(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="accountId",required=true)StringaccountId){ApplicationLogger.logInfo("Entering getDepositAccountBalance API");/* End of API call *//* Bank integration to get deposit account balance */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.DEPOSIT_ACCOUNT_BALANCE_API_END_POINT,customerId,accountId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Deposit Account Balance Response Body Before Transformation :"+response.getBody());StringaccountDetailResponseString=accountsResponseMapper.getManipulatedAccountsBalanceResponse(response.getBody());ApplicationLogger.logInfo("Deposit Account Balance Response Body After Transformation :"+response.getBody());depositAccountBalanceResponse=objectMapper.readValue(accountDetailResponseString,DepositAccountBalanceResponse.class);}returnResponseEntity.ok(depositAccountBalanceResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/deposit/plans");/* API to fetch deposit plans for fixed deposit */@ApiOperation(value="Returns available deposit service plans")@RequestMapping(value="/{customerId}/deposit/plans",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<DepositServiceResponse>getDepositPlans(@PathVariable(name="customerId",required=true)StringcustomerId,@RequestBodyfinalDepositServiceRequestdepositServiceRequest){ApplicationLogger.logInfo("Entering getDepositPlans API");/* End of API call *//* Bank integration to fetch deposit plans for fixed deposit */HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrl(PropertyConstants.DEPOSIT_PLAN_API_END_POINT,depositServiceRequest.getCustomerId(),depositServiceRequest.getCreditableAccounts().getAccountId())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("Deposit Plan API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo(" Deposit Plan Response Body Before Transformation :"+response.getBody());StringdepositPlanResponseString=depositPlanResponseMapper.getManipulatedDepositPlanResponse(response.getBody());ApplicationLogger.logInfo("Deposit Plan Response Body After Transformation :"+response.getBody());depositServiceResponse=objectMapper.readValue(depositPlanResponseString,DepositServiceResponse.class);}returnResponseEntity.ok(depositServiceResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/deposit/nominees");/* API to fetch nominees for fixed deposit */@ApiOperation(value="Returns nominees for deposit service")@RequestMapping(value="/{customerId}/deposit/nominees",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<DepositServiceResponse>getDepositPlanNominees(@PathVariable(name="customerId",required=true)StringcustomerId,@RequestBodyfinalDepositServiceRequestdepositServiceRequest){ApplicationLogger.logInfo("Entering getDepositPlanNominees API");/* End of API call *//* Bank integration to fetch nominees for fixed deposit */HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrl(PropertyConstants.NOMINEE_API_END_POINT,depositServiceRequest.getCustomerId(),depositServiceRequest.getCreditableAccounts().getAccountId())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("Nominee API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo(" Nominee Response Body Before Transformation :"+response.getBody());StringnomineesResponseString=depositPlanResponseMapper.getManipulatedNomineeResponse(response.getBody());ApplicationLogger.logInfo("Nominee Response Body After Transformation :"+response.getBody());depositServiceResponse=objectMapper.readValue(nomineesResponseString,DepositServiceResponse.class);}returnResponseEntity.ok(depositServiceResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/deposit/confirm");/* API to get status of opening or closing fixed deposit */@ApiOperation(value="Final API call for fixed deposit status and reference id ")@RequestMapping(value="/{customerId}/deposit/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<DepositServiceResponse>getDepositPlanFinalResponse(@PathVariable(name="customerId",required=true)StringcustomerId,@RequestBodyfinalDepositServiceRequestdepositServiceRequest){ApplicationLogger.logInfo("Entering getDepositPlanFinalResponse API");/* End of API call *//* Bank integration to get status of opening or closing fixed deposit */HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrl(PropertyConstants.OPEN_FD_API_END_POINT,depositServiceRequest.getCustomerId(),depositServiceRequest.getCreditableAccounts().getAccountId())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("Deposit Plan Final API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo(" Deposit Plan Final API Response Body Before Transformation :"+response.getBody());StringdepositPlanFinalAPiCallResponseString=depositPlanResponseMapper.getManipulatedDepositPlanFinalApiCallResponse(response.getBody());ApplicationLogger.logInfo("Deposit Plan Final API Response Body After Transformation :"+response.getBody());depositServiceResponse=objectMapper.readValue(depositPlanFinalAPiCallResponseString,DepositServiceResponse.class);}returnResponseEntity.ok(depositServiceResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/deposit/confirm");/* API to get status of opening or closing fixed deposit */@ApiOperation(value="Final API call for fixed deposit status and reference id ")@RequestMapping(value="/{customerId}/deposit/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<DepositServiceResponse>getDepositPlanFinalResponse(@PathVariable(name="customerId",required=true)StringcustomerId,@RequestBodyfinalDepositServiceRequestdepositServiceRequest){ApplicationLogger.logInfo("Entering getDepositPlanFinalResponse API");/* End of API call *//* Bank integration to get status of opening or closing fixed deposit */HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrl(PropertyConstants.OPEN_FD_API_END_POINT,depositServiceRequest.getCustomerId(),depositServiceRequest.getCreditableAccounts().getAccountId())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("Deposit Plan Final API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo(" Deposit Plan Final API Response Body Before Transformation :"+response.getBody());StringdepositPlanFinalAPiCallResponseString=depositPlanResponseMapper.getManipulatedDepositPlanFinalApiCallResponse(response.getBody());ApplicationLogger.logInfo("Deposit Plan Final API Response Body After Transformation :"+response.getBody());depositServiceResponse=objectMapper.readValue(depositPlanFinalAPiCallResponseString,DepositServiceResponse.class);}returnResponseEntity.ok(depositServiceResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/transfer/confirm");/* API to get transfer status */@RequestMapping(value="/{customerId}/transfer/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<FundTransferResponse>confirmTransfer(@PathVariable(value="customerId",required=true)IntegercustomerId,@RequestBodyfinalFundTransferRequestfundTransferRequest){ApplicationLogger.logInfo("Entering confirmTransfer API");/* End of API call *//* Bank integration to get transfer status */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrlForFundTransfer(PropertyConstants.TRANSFER_CONFIRM_API_END_POINT,fundTransferRequest)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Confirm Transfer Response Body Before Transformation :"+response.getBody());StringConfirmTransferResponseString=fundTransferResponseMapper.getManipulatedFundTransferResponse(response.getBody());ApplicationLogger.logInfo("Confirm Transfer Response Body After Transformation :"+response.getBody());fundTransferResponse=objectMapper.readValue(ConfirmTransferResponseString,FundTransferResponse.class);}returnResponseEntity.ok(fundTransferResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/transfer/payees");/* API to get list of payees */@RequestMapping(value="/{customerId}/transfer/payees",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<PayeesResponse>getPayeesList(@Valid@RequestBodyfinalPayeesRequestpayeeRequest,@PathVariable(value="customerId",required=true)IntegercustomerId){ApplicationLogger.logInfo("Entering getPayeesList API");/* End of API call *//* Bank integration to get list of payees */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrlForPayees(PropertyConstants.PAYEES_API_END_POINT,payeeRequest)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Payees Response Body Before Transformation :"+response.getBody());StringpayeesResponseString=fundTransferResponseMapper.getManipulatedPayeesResponse(response.getBody());ApplicationLogger.logInfo("Payees Response Body After Transformation :"+response.getBody());payeeResponse=objectMapper.readValue(payeesResponseString,PayeesResponse.class);}returnResponseEntity.ok(payeeResponse);
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/billers");/* API call to get list of registered billers */@ApiOperation(value="Returns list of registered billers based on customerId")@RequestMapping(value="/{customerId}/billers",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<BillerResponse>getRegisteredBillerListForCustomer(@PathVariable(name="customerId",required=true)StringcustomerId){ApplicationLogger.logInfo("Entering getRegisteredBillers API");/* End of API call *//*Bank integration to get list of registered billers */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.REGISTERED_BILLERS_API_ENDPOINT,customerId,null)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Registered Billers Response Body Before Transformation :"+response.getBody());StringbillerResponseString=billpaymentResponseMapper.getManipulatedRegisteredBillerResponse(response.getBody());ApplicationLogger.logInfo("Registered Billers Response Body After Transformation :"+response.getBody());billerResponse=objectMapper.readValue(billerResponseString,BillerResponse.class);}returnnewResponseEntity<>(billerResponse,HttpStatus.valueOf(response.getStatus()));
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/billers/{billerId}");/* API call to get biller details */@ApiOperation(value="Returns Biller details of biller based on billerId")@RequestMapping(value="/{customerId}/billers/{billerId}",produces={"application/json"},method=RequestMethod.GET)publicResponseEntity<BillerResponse>getBillerDetialsofBiller(@PathVariable(name="customerId",required=true)StringcustomerId,@PathVariable(name="billerId",required=true)StringbillerId){ApplicationLogger.logInfo("Entering getBillerDetails API");/* End of API call *//* Bank integration to get biller details */HttpResponse<String>response=Unirest.get(propertyUtil.getAPIUrl(PropertyConstants.BILLER_DETAILS_API_ENDPOINT,customerId,billerId)).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Biller Details Response Body Before Transformation :"+response.getBody());StringbillerDetailsResponseString=billpaymentResponseMapper.getManipulatedBillerDetailsResponse(response.getBody());ApplicationLogger.logInfo("Biller Details Response Body After Transformation :"+response.getBody());billerDetailsResponse=objectMapper.readValue(billerDetailsResponseString,BillerResponse.class);}returnnewResponseEntity<>(billerDetailsResponse,HttpStatus.valueOf(response.getStatus()));
URLobj=newURL("http://one-api.active.ai/banking-integration/v1/{customerId}/bill/payment/confirm");/* API to get bill payment status */@ApiOperation(value="Returns confirmation of bill payment")@RequestMapping(value="/{customerId}/bill/payment/confirm",produces={"application/json"},consumes={"application/json"},method=RequestMethod.POST)publicResponseEntity<BillPaymentResponse>confirmBillPayment(@PathVariable(value="customerId",required=true)StringcustomerId,@RequetBodyfinalBillPaymentRequestbillPaymentRequest){ApplicationLogger.logInfo("Entering getBillPaymentConfirm API");/* End of API call *//* Bank integration to get bill payment status */HttpResponse<String>response=Unirest.post(propertyUtil.getAPIUrl(PropertyConstants.BILL_PAYMENT_API_ENDPOINT,billPaymentRequest.getCustomerId(),billPaymentRequest.getBillerDetails().getBillerId())).header("cache-control","no-cache").asString();ApplicationLogger.logInfo("API Response status: "+response.getStatus()+" and response status text :"+response.getStatusText());if(Objects.nonNull(response)&&StringUtils.isNotEmpty(response.getBody())){ApplicationLogger.logInfo("Bill Payment Confirm Response Body Before Transformation :"+response.getBody());StringbillPaymentResponseString=billpaymentResponseMapper.getManipulatedBillPaymentResponse(response.getBody());ApplicationLogger.logInfo("Bill Payment Confirm Response Body After Transformation :"+response.getBody());billPaymentResponse=objectMapper.readValue(billPaymentResponseString,BillPaymentResponse.class);}returnnewResponseEntity<>(billPaymentResponse,HttpStatus.valueOf(response.getStatus()));