Support Logout NAV Navbar
Shell HTTP Java JavaScript Node.JS Python

Welcome

Triniti API

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.

Base URLs:

POST /process

Code samples

# You can also use wget
curl -X POST https://api.triniti.ai/v2/process \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: string' \
  -H 'X-Api-Secret: string' \
  -H 'X-User-Id: string' \
  -H 'X-Session-Id: string'

POST https://api.triniti.ai/v2/process HTTP/1.1
Host: api.triniti.ai
Content-Type: application/json
Accept: application/json
X-Api-Key: string
X-Api-Secret: string
X-User-Id: string
X-Session-Id: string

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-Api-Key':'string',
  'X-Api-Secret':'string',
  'X-User-Id':'string',
  'X-Session-Id':'string'

};

$.ajax({
  url: 'https://api.triniti.ai/v2/process',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "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"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-Api-Key':'string',
  'X-Api-Secret':'string',
  'X-User-Id':'string',
  'X-Session-Id':'string'

};

fetch('https://api.triniti.ai/v2/process',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'X-Api-Key' => 'string',
  'X-Api-Secret' => 'string',
  'X-User-Id' => 'string',
  'X-Session-Id' => 'string'
}

result = RestClient.post 'https://api.triniti.ai/v2/process',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-Api-Key': 'string',
  'X-Api-Secret': 'string',
  'X-User-Id': 'string',
  'X-Session-Id': 'string'
}

r = requests.post('https://api.triniti.ai/v2/process', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.triniti.ai/v2/process");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"string"},
        "X-Api-Secret": []string{"string"},
        "X-User-Id": []string{"string"},
        "X-Session-Id": []string{"string"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.triniti.ai/v2/process", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /process

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.
body body RequestObject true 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.

Example responses

200 Response

{
  "version": "string",
  "client-state-context": "string",
  "query-processor": {
    "input": "string",
    "corrected": "string",
    "normalised": "string",
    "punctuated": "string",
    "compressed": "string",
    "cleaned": "string"
  },
  "output": [
    {
      "query": "string",
      "expanded": "string",
      "expansion-confidence": 0,
      "adversity": 0,
      "emotion": "string",
      "emotion-score": 0,
      "subject-of-emotion": "string",
      "intention": {
        "confirmation": true,
        "cancellation": true,
        "negation": true
      },
      "product-actions": {
        "products": "string",
        "actions": "string"
      },
      "semantic-roles": {
        "general-purpose": [
          "string"
        ],
        "cause": [
          "string"
        ],
        "direction": [
          "string"
        ],
        "discourse-marker": [
          "string"
        ],
        "extent": [
          "string"
        ],
        "location": [
          "string"
        ],
        "manner": [
          "string"
        ],
        "modal-verb": [
          "string"
        ],
        "negation-marker": "string",
        "purpose": [
          "string"
        ],
        "predication": [
          "string"
        ],
        "reciprocal": [
          "string"
        ],
        "temporal": [
          "string"
        ]
      },
      "context-changed": true,
      "discourse-relationship": {
        "temporal-asynchronous": 0,
        "temporal-synchronous": 0,
        "contingency-cause": 0,
        "contingency-pragmatic-cause": 0,
        "comparison-contrast": 0,
        "comparison-concession": 0,
        "expansion-conjunction": 0,
        "expansion-instantiation": 0,
        "expansion-restatement": 0,
        "expansion-alternative": 0,
        "expansion-list": 0
      },
      "semantics": {
        "sentence-type": "string",
        "response-type": "string",
        "response-grain": "string",
        "event-tense": "string",
        "semantic-parse": "string"
      },
      "top-intent": {
        "name": "string",
        "confidence": 0
      },
      "all-intents": [
        {
          "name": "string",
          "confidence": 0
        }
      ],
      "fragment": [
        {
          "expansion": "string"
        }
      ],
      "modifiers": [
        "string"
      ],
      "entities": [
        {
          "name": "string",
          "modifier": "string",
          "value": "string",
          "confidence": 0
        }
      ],
      "triniti-state-context": "string",
      "response": {
        "message": "string",
        "confidence": 0
      },
      "user-options": [
        {
          "label": "string",
          "value": "string"
        }
      ],
      "similar": [
        {
          "id": "string",
          "query": "string",
          "answer": "string",
          "confidence": 0
        }
      ],
      "debug": {
        "faq-subtopic": "string",
        "faq-subtopic-confidence": 0,
        "faq-topic": "string",
        "faq-topic-confidence": 0,
        "faq-products": "string",
        "faq-candidates": "string"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK ResponseObject
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Schemas

RequestObject

{
  "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
options [string] false none none

ResponseObject

{
  "version": "string",
  "client-state-context": "string",
  "query-processor": {
    "input": "string",
    "corrected": "string",
    "normalised": "string",
    "punctuated": "string",
    "compressed": "string",
    "cleaned": "string"
  },
  "output": [
    {
      "query": "string",
      "expanded": "string",
      "expansion-confidence": 0,
      "adversity": 0,
      "emotion": "string",
      "emotion-score": 0,
      "subject-of-emotion": "string",
      "intention": {
        "confirmation": true,
        "cancellation": true,
        "negation": true
      },
      "product-actions": {
        "products": "string",
        "actions": "string"
      },
      "semantic-roles": {
        "general-purpose": [
          "string"
        ],
        "cause": [
          "string"
        ],
        "direction": [
          "string"
        ],
        "discourse-marker": [
          "string"
        ],
        "extent": [
          "string"
        ],
        "location": [
          "string"
        ],
        "manner": [
          "string"
        ],
        "modal-verb": [
          "string"
        ],
        "negation-marker": "string",
        "purpose": [
          "string"
        ],
        "predication": [
          "string"
        ],
        "reciprocal": [
          "string"
        ],
        "temporal": [
          "string"
        ]
      },
      "context-changed": true,
      "discourse-relationship": {
        "temporal-asynchronous": 0,
        "temporal-synchronous": 0,
        "contingency-cause": 0,
        "contingency-pragmatic-cause": 0,
        "comparison-contrast": 0,
        "comparison-concession": 0,
        "expansion-conjunction": 0,
        "expansion-instantiation": 0,
        "expansion-restatement": 0,
        "expansion-alternative": 0,
        "expansion-list": 0
      },
      "semantics": {
        "sentence-type": "string",
        "response-type": "string",
        "response-grain": "string",
        "event-tense": "string",
        "semantic-parse": "string"
      },
      "top-intent": {
        "name": "string",
        "confidence": 0
      },
      "all-intents": [
        {
          "name": "string",
          "confidence": 0
        }
      ],
      "fragment": [
        {
          "expansion": "string"
        }
      ],
      "modifiers": [
        "string"
      ],
      "entities": [
        {
          "name": "string",
          "modifier": "string",
          "value": "string",
          "confidence": 0
        }
      ],
      "triniti-state-context": "string",
      "response": {
        "message": "string",
        "confidence": 0
      },
      "user-options": [
        {
          "label": "string",
          "value": "string"
        }
      ],
      "similar": [
        {
          "id": "string",
          "query": "string",
          "answer": "string",
          "confidence": 0
        }
      ],
      "debug": {
        "faq-subtopic": "string",
        "faq-subtopic-confidence": 0,
        "faq-topic": "string",
        "faq-topic-confidence": 0,
        "faq-products": "string",
        "faq-candidates": "string"
      }
    }
  ]
}

ResponseObject

Properties

Name Type Required Restrictions Description
version string false none 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.
query-processor QueryProcessor false none Output of query processor engine
output [Output] false none Analysis of the input query split based on sentence.

QueryProcessor

{
  "input": "string",
  "corrected": "string",
  "normalised": "string",
  "punctuated": "string",
  "compressed": "string",
  "cleaned": "string"
}

Properties

Name Type Required Restrictions Description
input string false none This is the input provided in the query parameters. Returned for purposes for reference and for use in stateless implementations
corrected string false none This is the intermediate output after spelling correction and acronym expansion.
normalised string false none This is the final output used for processing further. After performing Date and Number processing into standard formats.
punctuated string false none The normalised input is punctuated to identify multiple sentences and for removal of noise by means of compression
compressed string false none The punctuated input is compressed to remove all informative parts.
cleaned string false none Not Implemented

Output

{
  "query": "string",
  "expanded": "string",
  "expansion-confidence": 0,
  "adversity": 0,
  "emotion": "string",
  "emotion-score": 0,
  "subject-of-emotion": "string",
  "intention": {
    "confirmation": true,
    "cancellation": true,
    "negation": true
  },
  "product-actions": {
    "products": "string",
    "actions": "string"
  },
  "semantic-roles": {
    "general-purpose": [
      "string"
    ],
    "cause": [
      "string"
    ],
    "direction": [
      "string"
    ],
    "discourse-marker": [
      "string"
    ],
    "extent": [
      "string"
    ],
    "location": [
      "string"
    ],
    "manner": [
      "string"
    ],
    "modal-verb": [
      "string"
    ],
    "negation-marker": "string",
    "purpose": [
      "string"
    ],
    "predication": [
      "string"
    ],
    "reciprocal": [
      "string"
    ],
    "temporal": [
      "string"
    ]
  },
  "context-changed": true,
  "discourse-relationship": {
    "temporal-asynchronous": 0,
    "temporal-synchronous": 0,
    "contingency-cause": 0,
    "contingency-pragmatic-cause": 0,
    "comparison-contrast": 0,
    "comparison-concession": 0,
    "expansion-conjunction": 0,
    "expansion-instantiation": 0,
    "expansion-restatement": 0,
    "expansion-alternative": 0,
    "expansion-list": 0
  },
  "semantics": {
    "sentence-type": "string",
    "response-type": "string",
    "response-grain": "string",
    "event-tense": "string",
    "semantic-parse": "string"
  },
  "top-intent": {
    "name": "string",
    "confidence": 0
  },
  "all-intents": [
    {
      "name": "string",
      "confidence": 0
    }
  ],
  "fragment": [
    {
      "expansion": "string"
    }
  ],
  "modifiers": [
    "string"
  ],
  "entities": [
    {
      "name": "string",
      "modifier": "string",
      "value": "string",
      "confidence": 0
    }
  ],
  "triniti-state-context": "string",
  "response": {
    "message": "string",
    "confidence": 0
  },
  "user-options": [
    {
      "label": "string",
      "value": "string"
    }
  ],
  "similar": [
    {
      "id": "string",
      "query": "string",
      "answer": "string",
      "confidence": 0
    }
  ],
  "debug": {
    "faq-subtopic": "string",
    "faq-subtopic-confidence": 0,
    "faq-topic": "string",
    "faq-topic-confidence": 0,
    "faq-products": "string",
    "faq-candidates": "string"
  }
}

Properties

Name Type Required Restrictions Description
query string false none 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.
intention Intention false none List of intentions
product-actions ProductActions false none List of products and actions
semantic-roles SemanticRoles false none List of semantic roles
context-changed boolean false none Return True if the current input from the user is not in context of the conversation
discourse-relationship DiscourseRelationship false none This return the top 3 probable relationships between the users previous input and the current one.
semantics Semantics false none none
top-intent Intent false none This is the Top Intent that the classifier has identified. It has “name” of the intent and the “confidence”
all-intents [Intent] false none This is a collection of upto 3 intents which were returned by the classifier. If available.
fragment [Fragment] false none List of fragments
modifiers [string] false none List of Modifier String that were found in users utterance
entities [Entities] false none List of entities
triniti-state-context string false none 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.
response Response false none none
user-options [UserOptions] false none List of user options
similar [Similar] false none none
debug Debug false none This contains debug information, that can communicate errors, exceptions and other information that can be useful to debug and behaviour from triniti.

Intention

{
  "confirmation": true,
  "cancellation": true,
  "negation": true
}

Properties

Name Type Required Restrictions Description
confirmation boolean false none Return True if user provides an input that denotes confirmation of the bots confirmation.
cancellation boolean false none Returns True if user expresses his wish to abort the current conversation
negation boolean false none Returns True if user negates his input. Such as “the amount is not 400”

ProductActions

{
  "products": "string",
  "actions": "string"
}

Properties

Name Type Required Restrictions Description
products string false none List of Product Strings that were mentioned in the users input
actions string false none List of Action Verbs mentioned in the users input.

SemanticRoles

{
  "general-purpose": [
    "string"
  ],
  "cause": [
    "string"
  ],
  "direction": [
    "string"
  ],
  "discourse-marker": [
    "string"
  ],
  "extent": [
    "string"
  ],
  "location": [
    "string"
  ],
  "manner": [
    "string"
  ],
  "modal-verb": [
    "string"
  ],
  "negation-marker": "string",
  "purpose": [
    "string"
  ],
  "predication": [
    "string"
  ],
  "reciprocal": [
    "string"
  ],
  "temporal": [
    "string"
  ]
}

Returns list of Semantic Roles applicable in the given input and the phrases performing that role.

Properties

Name Type Required Restrictions Description
general-purpose [string] false none none
cause [string] false none none
direction [string] false none none
discourse-marker [string] false none none
extent [string] false none none
location [string] false none none
manner [string] false none none
modal-verb [string] false none none
negation-marker string false none none
purpose [string] false none none
predication [string] false none none
reciprocal [string] false none none
temporal [string] false none none

DiscourseRelationship

{
  "temporal-asynchronous": 0,
  "temporal-synchronous": 0,
  "contingency-cause": 0,
  "contingency-pragmatic-cause": 0,
  "comparison-contrast": 0,
  "comparison-concession": 0,
  "expansion-conjunction": 0,
  "expansion-instantiation": 0,
  "expansion-restatement": 0,
  "expansion-alternative": 0,
  "expansion-list": 0
}

This return the top 3 probable relationships between the users previous input and the current one.

Properties

Name Type Required Restrictions Description
temporal-asynchronous integer false none none
temporal-synchronous integer false none none
contingency-cause integer false none none
contingency-pragmatic-cause integer false none none
comparison-contrast integer false none none
comparison-concession integer false none none
expansion-conjunction integer false none none
expansion-instantiation integer false none none
expansion-restatement integer false none none
expansion-alternative integer false none none
expansion-list integer false none none

Semantics

{
  "sentence-type": "string",
  "response-type": "string",
  "response-grain": "string",
  "event-tense": "string",
  "semantic-parse": "string"
}

Properties

Name Type Required Restrictions Description
sentence-type string false none 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.

Entities

{
  "name": "string",
  "modifier": "string",
  "value": "string",
  "confidence": 0
}

Properties

Name Type Required Restrictions Description
name string false none Name of the Entity
modifier string false none Modifier Attached to the entity “to”, “from”
value string false none Value of the Entity that is extracted
confidence integer false none Confidence Level on a scale of 0-1

Response

{
  "message": "string",
  "confidence": 0
}

Properties

Name Type Required Restrictions Description
message string false none none
confidence integer false none none

UserOptions

{
  "label": "string",
  "value": "string"
}

Properties

Name Type Required Restrictions Description
label string false none Label of the user options to be presented to the user.
value string false none Value to be sent back to triniti if the user selects that option.

Similar

{
  "id": "string",
  "query": "string",
  "answer": "string",
  "confidence": 0
}

Properties

Name Type Required Restrictions Description
id string false none ID of similar question as what the user asked
query string false none The question that is similar
answer string false none Answer to be shown if user selects this question.
confidence integer false none Score between 0 - 1.0 denoting the similarity of the question user asked and this one.

Debug

{
  "faq-subtopic": "string",
  "faq-subtopic-confidence": 0,
  "faq-topic": "string",
  "faq-topic-confidence": 0,
  "faq-products": "string",
  "faq-candidates": "string"
}

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 -

https://{domain}/morfeus/v1/channels/{botChannelId}/{apis}

Initializing the SDK

The /init endpoint initialises new chat session. For a WEB client, this API will return a welcome message.

POST https://{domain}/morfeus/v1/channels/{botChannelId}/init

Sample Request

curl -X 'POST' \
  'https://{domain}/morfeus/v1/channels/34w33145763139/init' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: gqs0ijhvnj' \
  -H 'Content-Type: application/json' \
  -d '{
    "sdkVersion": "0.5.0-SNAPSHOT",
    "sdkType": "I",
    "messageId": "mid.u4764lmi",
    "messageType": "text",
    "messageContent": "Hi"
}'
POST https://{domain}/morfeus/v1/channels/34w33145763139/init HTTP/1.1
content-type: application/json

{
    "sdkVersion": "0.5.0-SNAPSHOT",
    "sdkType": "I",
    "messageId": "mid.u4764lmi",
    "messageType": "text",
    "messageContent": "Hi"
}

Sample Response

{
  "inDeveloperMode": true,
  "conversation": {
    "from": "string",
    "to": "string",
    "requestId": "string"
  },
  "messages": [
    {
      "id": "string",
      "message": {}
    }
  ],
  "debugData": {
    "aiModel": {
      "intent": {
        "name": "string",
        "confidence": 0,
        "adversarialScore": 0,
        "starter": true,
        "userSelection": true
      },
      "state": "string",
      "ignoreSignatureCheck": true,
      "continueLastTransaction": true,
      "tokenCount": 0,
      "compoundQuery": true,
      "tentativeContextChange": true
    },
    "defaultLangCode": "string",
    "externalCalls": [
      {}
    ]
  },
  "initData": {},
  "quick_replies": [
    {}
  ],
  "inputProperties": {
    "keyboardState": "string"
  }
}

For request and response can refer below files

Click here for Swagger UI

Initializing the SDK with existing session

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

Sample Request

curl -X 'POST' \
  'https://{domain}/morfeus/v1/channels/34w33145763139/init' \
  -H 'accept: application/json' \
  -H 'm-auth: {“sessionId”: “XXXXXXXXXXXXX”}' \
  -H 'Content-Type: application/json' \
  -d '{
  "sdkVersion": "0.5.0-SNAPSHOT",
  "sdkType": "I",
  "messageId": "mid.u4764lmi",
  "messageType": "text",
  "messageContent": "Hi"
}'
POST https://{domain}/morfeus/v1/channels/34w33145763139/init HTTP/1.1
content-type: application/json
m-auth: {“sessionId”: “XXXXXXXXXXXXX”}

{
    "sdkVersion": "0.5.0-SNAPSHOT",
    "sdkType": "I",
    "messageId": "mid.u4764lmi",
    "messageType": "text",
    "messageContent": "Hi"
}

Sample Response

{
  "inDeveloperMode": true,
  "conversation": {
    "from": "string",
    "to": "string",
    "requestId": "string"
  },
  "messages": [
    {
      "id": "string",
      "message": {}
    }
  ],
  "debugData": {
    "aiModel": {
      "intent": {
        "name": "string",
        "confidence": 0,
        "adversarialScore": 0,
        "starter": true,
        "userSelection": true
      },
      "state": "string",
      "ignoreSignatureCheck": true,
      "continueLastTransaction": true,
      "tokenCount": 0,
      "compoundQuery": true,
      "tentativeContextChange": true
    },
    "defaultLangCode": "string",
    "externalCalls": [
      {}
    ]
  },
  "initData": {},
  "quick_replies": [
    {}
  ],
  "inputProperties": {
    "keyboardState": "string"
  }
}

Auth Login

The /authLogin API allows the partner would initiate login flow as per their standard.

POST https://{domain}/morfeus/v1/channels/{botChannelId}/authlogin

Sample Request

curl -X 'POST' \
  'https://{domain}/morfeus/v1/channels/34w33145763139/authlogin' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: gqs0ijhvnj' \
  -H 'Content-Type: application/json' \
  -d '{
  "username": "testUser",
  "password": "password",
  "token": "asdfghjklasd",
  "sdkType": "I"
}'
POST https://{domain}/morfeus/v1/channels/34w33145763139/authlogin HTTP/1.1
content-type: application/json

{
  "username": "testUser",
  "password": "password",
  "token": "asdfghjklasd",
  "sdkType": "I"
}

Sample Response

{
  "inDeveloperMode": true,
  "conversation": {
    "from": "string",
    "to": "string",
    "requestId": "string"
  },
  "messages": [
    {
      "id": "string",
      "message": {}
    }
  ],
  "debugData": {
    "aiModel": {
      "intent": {
        "name": "string",
        "confidence": 0,
        "adversarialScore": 0,
        "starter": true,
        "userSelection": true
      },
      "state": "string",
      "ignoreSignatureCheck": true,
      "continueLastTransaction": true,
      "tokenCount": 0,
      "compoundQuery": true,
      "tentativeContextChange": true
    },
    "defaultLangCode": "string",
    "externalCalls": [
      {}
    ]
  },
  "initData": {},
  "quick_replies": [
    {}
  ],
  "inputProperties": {
    "keyboardState": "string"
  }
}

Sending Messages

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

Sample Request

curl -X 'POST' \
  'https://router.triniti.ai/morfeus/v1/channels/36w70149553913/authMessage' \
  -H 'accept: application/json' \
  -H 'm-auth: {“sessionId”: “XXXXXXXXXXXXX”}' \
  -H 'Content-Type: application/json' \
  -d '{
  "sdkVersion": "0.5.0-SNAPSHOT",
  "sdkType": "I",
  "messageId": "mid.u4764lmi",
  "messageType": "text",
  "messageContent": "Hello"
}'

POST https://{domain}/morfeus/v1/channels/34w33145763139/authMessage HTTP/1.1
content-type: application/json
m-auth: {“sessionId”: “XXXXXXXXXXXXX”}

{
    "sdkVersion": "0.5.0-SNAPSHOT",
    "sdkType": "I",
    "messageId": "mid.u4764lmi",
    "messageType": "text",
    "messageContent": "Hello"
}

Sample Response

{
  "inDeveloperMode": true,
  "conversation": {
    "from": "string",
    "to": "string",
    "requestId": "string"
  },
  "messages": [
    {
      "id": "string",
      "message": {}
    }
  ],
  "debugData": {
    "aiModel": {
      "intent": {
        "name": "string",
        "confidence": 0,
        "adversarialScore": 0,
        "starter": true,
        "userSelection": true
      },
      "state": "string",
      "ignoreSignatureCheck": true,
      "continueLastTransaction": true,
      "tokenCount": 0,
      "compoundQuery": true,
      "tentativeContextChange": true
    },
    "defaultLangCode": "string",
    "externalCalls": [
      {}
    ]
  },
  "initData": {},
  "quick_replies": [
    {}
  ],
  "inputProperties": {
    "keyboardState": "string"
  }
}

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

Sample Request

curl -X 'POST' \
  'https://router.triniti.ai/morfeus/v1/channels/36w70149553913/message' \
  -H 'accept: application/json' \
  -H 'm-auth: {“sessionId”: “XXXXXXXXXXXXX”}' \
  -H 'Content-Type: application/json' \
  -d '{
  "sdkVersion": "0.5.0-SNAPSHOT",
  "sdkType": "I",
  "messageId": "mid.u4764lmi",
  "messageType": "text",
  "messageContent": "Hello"
}'

POST https://{domain}/morfeus/v1/channels/34w33145763139/message HTTP/1.1
content-type: application/json
m-auth: {“sessionId”: “XXXXXXXXXXXXX”}

{
    "sdkVersion": "0.5.0-SNAPSHOT",
    "sdkType": "I",
    "messageId": "mid.u4764lmi",
    "messageType": "text",
    "messageContent": "Hello"
}

Sample Response

{
  "inDeveloperMode": true,
  "conversation": {
    "from": "string",
    "to": "string",
    "requestId": "string"
  },
  "messages": [
    {
      "id": "string",
      "message": {}
    }
  ],
  "debugData": {
    "aiModel": {
      "intent": {
        "name": "string",
        "confidence": 0,
        "adversarialScore": 0,
        "starter": true,
        "userSelection": true
      },
      "state": "string",
      "ignoreSignatureCheck": true,
      "continueLastTransaction": true,
      "tokenCount": 0,
      "compoundQuery": true,
      "tentativeContextChange": true
    },
    "defaultLangCode": "string",
    "externalCalls": [
      {}
    ]
  },
  "initData": {},
  "quick_replies": [
    {}
  ],
  "inputProperties": {
    "keyboardState": "string"
  }
}

Feedback

This Api help us to get feedback from the user on conversations.

POST https://{domain}/morfeus/v1/channels/{botChannelId}/feedback

Sample Request

curl -X 'POST' \
  'https://router.triniti.ai/morfeus/v1/channels/36w70149553913/message' \
  -H 'accept: application/json' \
  -H 'm-auth: {“sessionId”: “XXXXXXXXXXXXX”}' \
  -H 'Content-Type: application/json' \
  -d '{
  "sdkVersion": "0.5.0-SNAPSHOT",
  "sdkType": "I",
  "messageId": "mid.u4764lmi",
  "messageType": "text",
  "messageContent": "good"
}'

POST https://{domain}/morfeus/v1/channels/34w33145763139/message HTTP/1.1
content-type: application/json
m-auth: {“sessionId”: “XXXXXXXXXXXXX”}

{
    "sdkVersion": "0.5.0-SNAPSHOT",
    "sdkType": "I",
    "messageId": "mid.u4764lmi",
    "messageType": "text",
    "messageContent": "good"
}

Sample Response

{
  "inDeveloperMode": true,
  "conversation": {
    "from": "string",
    "to": "string",
    "requestId": "string"
  },
  "messages": [
    {
      "id": "string",
      "message": {}
    }
  ],
  "debugData": {
    "aiModel": {
      "intent": {
        "name": "string",
        "confidence": 0,
        "adversarialScore": 0,
        "starter": true,
        "userSelection": true
      },
      "state": "string",
      "ignoreSignatureCheck": true,
      "continueLastTransaction": true,
      "tokenCount": 0,
      "compoundQuery": true,
      "tentativeContextChange": true
    },
    "defaultLangCode": "string",
    "externalCalls": [
      {}
    ]
  },
  "initData": {},
  "quick_replies": [
    {}
  ],
  "inputProperties": {
    "keyboardState": "string"
  }
}

For request and response look at the Swagger file.

Processing a Response

The response protocol consists of a payload describing the various layouts in which to render the response from the server.

The broad structure is as below:

Attribute Type Description
type String Use to identify whether the layout uses a custom or a pre bundled template
templateType String Type of layout to be rendered
element Object Array of UX elements to be rendered in the layout

Element attribute has the following data structure:

Attribute Sub Attributes Description
title text Text to be displayed in title
type Type of component i.e. label
subtitle text Text to be displayed in title
type Type of component i.e. label
image type Type of component i.e. image
imageName pre bundled image name
imageUrl url to download image, if not found in assets
buttons text Text to display as title
type type of component i.e. button
action Type of action to perform on click of button
payload Payload to send to server on postback action
allowMultipleClicks True/False True - allows multiple clicksFalse - block action after single click
radio True/Fasle True - Disable other buttons if any one of button in group is clicked

List of actions supported:

Attribute Description
postback payload property of button need to be sent back to server via authMessage API call
authenticateWithTouchId client has to show touchID for authentication
showInfo webview page need to be loaded with the url passed in payload property of button

Sample Response:

{
    "conversation": {
        "from": "34 a55681825652",
        "
        "to": "764866220807094"
    },
    "messages": [{
        "from": "34 a55681 825652 ",
        "
        id ": "
        mid.1504109628458103.70595936411 ",
        "message": {
            "card": {
                "content": [{
                    "element": {
                        "image": {
                            "imageName": "activewelcome.png",
                            "imageUrl": "activewelcome.png",
                            "type": "image"
                        },
                        "subtitle": {
                            "text": "I am a super powered banking assistant. I can tell you your balances, pay bills, recharge prepaid, and much more?",
                            "type": "label"
                        },
                        "title": {
                            "text": "Hi!",
                            "type": "label"
                        }
                    }
                }],
                "templateType": "InfoCardTemplate"
            },
            "type": "custom "
        },
        "
        to ": "
        764866220807094 "
    }]
}

Supported Layouts

Image and Text

Sample Image Response

{
    "messages": [{

        "id": "mid.15040753.7832063.70778724705",
        
"message": {

            "type": "custom",
            
"card": {
                "templateType": "InfoCardTemplate",
                "content": [
{

                    "element": {
                        "title": {

                            "text": "Your balance is INR 4,712.56.",
                            
"type": "label"

                        },
                        
"subtitle": {
                            "text": "Regular Savings Account - xxxx8765",
                            
"type": "label"

                        },
                        
"image": {
                            "type": "image",
                            
"imageName": "SA%20image.PNG",
                            
"imageUrl": "https://image1.s3.amazonaws.com/image.PNG"

                        },
                        
"buttons": [{

                            "text": "Latest Transactions",
                            
"type": "button",
                            
"payload": "{\"payloadData\":{}",
                            
"action": "postback",
                            
"allowMultipleClicks": true,
                            
"radio": false

                        }
]

                    }

                }
]

            }
        }
    }]
}

This layout displays image and text with a call to action via buttons. The templateType value for this is “InfoCardTemplate”

Android

Android image

iOS

Ios image

Buttons

Sample Button Response

{
    "messages": [{
        "id": "mid.1568090801929966801787754330",
        "message": {
            "type": "custom",
            "card": {
                "templateType": "ButtonCardTemplate",
                "content": [{
                    "element": {
                        "title": {
                            "text": "Some Header Text",
                            "type": "label"
                        },
                        "buttons": [{
                            "text": "Confirm",
                            "type": "button",
                            "payload": "{}",
                            "action": "postback",
                            "allowMultipleClicks": false,
                            "radio": false
                        }, {
                            "text": "Cancel",
                            "type": "button",
                            "payload": "{}",
                            "action": "postback",
                            "allowMultipleClicks": false,
                            "radio": false
                        }]
                    }
                }],
                "tabContent": []
            },
            "payload": {}
        },
        "response": null
    }]
}

This layout displays text with a call to action via buttons. The templateType value for this is “ButtonCardTemplate”

Android

Android buttons

iOS

Ios buttons

Sample Carousel Template

{

    "conversation": {

        "from": "162a61380363039",
        
"to": "678268006057777"

    },
    
"messages": [
{

        "id": "mid.15040753.7832063.70778724705",
        
"message": {

            "type": "custom",
            
"card": {

                "templateType": "InfoCardTemplate",
                
"content": [
{

                    "element": {

                        "title": {

                            "text": "Your balance is NA.",
                            
"type": "label"

                        },
                        
"subtitle": {

                            "text": "Easy Access Savings Account - xxxx6545",
                            
"type": "label"

                        },
                        
"image": {

                            "type": "image",
                            
"imageName": "SA%20image.PNG",
                            
"imageUrl": "SA%20image.PNG"

                        },
                        
"buttons": [
{

                            "text": "Latest Transactions",
                            
"type": "button",
                            
"payload": "{\"payloadData\":{}",
                            
"action": "postback",
                            
"allowMultipleClicks": true,
                            
"radio": false

                        }
]

                    }

                }, 
 {

                    "element": {

                        "title": {

                            "text": "Your balance is INR 4,712.56.",
                            
"type": "label"

                        },
                        
"subtitle": {

                            "text": "Regular Savings Account - xxxx8765",
                            
"type": "label"

                        },
                        
"image": {

                            "type": "image",
                            
"imageName": "SA%20image.PNG",
                            
"imageUrl": "https://image1.s3.amazonaws.com/SA%20image.PNG"

                        },
                        
"buttons": [
{

                            "text": "Latest Transactions",
                            
"type": "button",
                            
"payload": "{\"payloadData\":{}",
                            
"action": "postback",
                            
"allowMultipleClicks": true,
                            
"radio": false

                        }
]

                    }

                }, 
 {

                    "element": {

                        "title": {

                            "text": "Your balance is INR 8,712.56.",
                            
"type": "label"

                        },
                        
"subtitle": {

                            "text": "SavingsMax Account - xxxx9015",
                            
"type": "label"

                        },
                        
"image": {

                            "type": "image",
                            
"imageName": "SA%20image.PNG",
                            
"imageUrl": "https://image1.s3.amazonaws.com/SA%20image.PNG"

                        },
                        
"buttons": [
{

                            "text": "Latest Transactions",
                            
"type": "button",
                            
"payload": "{\"payloadData\":{}",
                            
"action": "postback",
                            
"allowMultipleClicks": true,
                            
"radio": false

                        }
]

                    }

                }
]

            }

        }

    }
]

}

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.

Android

Android carousel

iOS

Ios carousel

List

Sample List Template

{

    "messages": [
{

        "id": "mid.1504073519578559945310732310",
        
"message": {

            "type": "custom",
            
"card": {

                "templateType": "ListCardTemplate",
                
"content": [
{

                    "element": {

                        "title": {

                            "text": "91xx6xxx53 mobile",
                            
"type": "label"

                        },
                        
"subtitle": {

                            "text": " INR 22.00",
                            
"type": "label"

                        },
                        
"buttons": [
{

                            "text": "Repeat",
                            
"type": "button",
                            
"payload": "{\"payloadData\":{}",
                            
"action": "postback",
                            
"allowMultipleClicks": true,
                            
"radio": false

                        }
]

                    }

                }, 
 {

                    "element": {

                        "title": {

                            "text": "91xx6xxx53 mobile",
                            
"type": "label"

                        },
                        
"subtitle": {

                            "text": " INR 22.00",
                            
"type": "label"

                        },
                        
"buttons": [
{

                            "text": "Repeat",
                            
"type": "button",
                            
"payload": "{\"payloadData\":{}",
                            
"action": "postback",
                            
"allowMultipleClicks": true,
                            
"radio": false

                        }
]

                    }

                }, 
 {

                    "element": {

                        "title": {

                            "text": "80xx8xxx75 Data Card",
                            
"type": "label"

                        },
                        
"subtitle": {

                            "text": " INR 300.00",
                            
"type": "label"

                        },
                        
"buttons": [
{

                            "text": "Repeat",
                            
"type": "button",
                            
"payload": "{\"payloadData\":{}",
                            
"action": "postback",
                            
"allowMultipleClicks": true,
                            
"radio": false

                        }
]

                    }

                }, 
 {

                    "element": {

                        "title": {

                            "text": "Or, would you like to do a new recharge",
                            
"type": "label"

                        },
                        
"buttons": [
{

                            "text": "New Recharge",
                            
"type": "button",
                            
"payload": "{\"payloadData\":{}",
                            
"action": "postback",
                            
"allowMultipleClicks": true,
                            
"radio": false

                        }
]

                    }

                }
],
                
"elementStyle": "compact"

            }

        }

    }
]

}

This layout displays text, image and button in list format.The templateType value for this is “ListCardTemplate”

Android

Android list

iOS

Ios list

Sending User Responses

Sample request for Postback action

{

    "userId": 319832270493277,
    
"messageContent": "{\"payloadData\":{}",
    
"messageId": 1504086070392,
    
"messageType": "postback",
    
"customerId": "123456789",
    

}

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.
messageType Set postback for postback message.
messageId Unique message Id
customerId Unique customer Id

Handling WebViews

Below is the sample Login response from webview

{
    "type": "webviewMessage",
    "messages": [{
        "id": "mid.1504162991375572079300630827",
        "message": {
            "type": "text",
            "text": "You have been logged in successfully"
        }
    }],
    "headers": {
        "MORFEUSSESSIONID": "OTFjN2ZiMjQtNzAyYy00YmE0LTg5NjMtOWRlMzhkODhjY2Vk",
        "applicationId": "fe62644a-1da0-4e02-81fd-23e8d059042a",
        "X-CSRF-Token": "026d324a-0e15-4004-b220-cb26a84df6d4",
        "from": "100a84495335333",
        "to": "432713231204881"
    }
}

In some cases a call to action can be for a WebView (WebBrowser) which can be open as a whole or inline (overlayed upon the conversational SDK)

Invoking Webview

On server response with call to action as “showInfo” SDK need to open webview. URL need to taken from payload property.

Webview to SDK communication

Responses from WebView to conversation SDK is through PostMessage method call. Data from the webview is passed in JSON format.

Webview has to call postMessage api with JSON data as string format with respective native interface object.

        if (jQuery.fn.websdk.channelType === 'w') {
            var message = [{
                type: "webviewMessage",
                messages: messages
            }, {
                type: "websdkidletimeoutTrigger",
                messages: messages
            }];
            for (var i = 0; i < message.length; i++) {
                parent.postMessage(message[i], window.location.protocol + "//" + window.location.host);
            }

        } else if (jQuery.fn.websdk.channelType === 'a') {
            var nativeMessage = {
                type: "webviewMessage",
                messages: messages,
                headers: {
                    "MORFEUSSESSIONID": “”,
                    "applicationId": “”,
                    "X-CSRF-Token": “”,
                    "from": conversation.from,
                    "to": conversation.to
                }
            }
            if (window.MFWebInterface) {
                window.MFWebInterface.postMessage(JSON.stringify(nativeMessage));
            }

        } else if (jQuery.fn.websdk.channelType === 'i') {

            var nativeMessage = {
                type: "webviewMessage",
                messages: messages,
                headers: {
                    "MORFEUSSESSIONID": getStorage("MORFEUSSESSIONID"),
                    "applicationId": getStorage("applicationId"),
                    "X-CSRF-Token": getStorage('aisession'),
                    "from": conversation.from,
                    "to": conversation.to
                }
            }

            if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.MFWebInterface) {
                window.webkit.messageHandlers.MFWebInterface.postMessage(JSON.stringify(nativeMessage));
            }
        }

        }

Response Attributes
Attribute Sub Attributes Description
type 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' \
POST https://morfeusadmin.active.ai/morfeusadmin/api/login/authenticate/jwt HTTP/1.1
Host: morfeusadmin.active.ai
Content-Type : application/json
var headers = {
    'Content-Type':'application/json'
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfeusadmin/api/login/authenticate/jwt",
    method: 'post',

    headers: headers,
    success: function(data) {
    console.log(JSON.stringify(data));
        }
}}
String url = "https://morfeusadmin.active.ai/morfeusadmin/api/login/authenticate/jwt";
    RequestObject requestData = {{requestBody}};
    CloseableHttpClient client = HttpClients.createDefault();
    HttpPost httpPost = new HttpPost(url);
    ObjectMapper objectMapper = new ObjectMapper();
    String json = objectMapper.writeValueAsString(requestData);
    StringEntity enitity = new StringEntity(json);
    httpPost.setEntity(entity);
    httpPost.setHeader("Content-Type", "application/json");
    client.execute();
    client.close();

Body Parameters

    {
    "userId": "{{user id}}",
    "secretKey": "{{secret key}}",
    "botCode": "{{Bot code}}"
    }

Parameters

Parameter In Type Required Description
Content-Type header application/json true Media type of the resource
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Create Bot

POST /morfeusadmin/openapi/bot

Code Samples

curl -X POST https://morfeusadmin.active.ai/morfeusadmin/openapi/bot \
  -H 'JWT-Auth-Token: {{auth.token}}' \
  -H 'Content-Type: application/json' \
POST https://morfeusadmin.active.ai/morfeusadmin/openapi/bot HTTP/1.1
Host: morfeusadmin.active.ai
JWT-Auth-Token: {{auth.token}}
Content-Type: application/json
var headers = {
    'JWT-Auth-Token' : '{{auth.token}}',
    'Content-Type' : 'application/json'
    };

    $.ajax({
        url: 'https://morfeusadmin.active.ai/morfeusadmin/openapi/bot',
        method: 'post',

        headers: headers,
        success: function(data) {
        console.log(JSON.stringify(data));
        }
    })
    String url = "https://morfeusadmin.active.ai/morfeusadmin/openapi/bot";
    RequestObject request = {{requestBody}};
    CloseableHttpClient client = HttpClients.createDefault();
    HttpPost httpPost = new HttpPost(url);
    ObjectMapper objectMapper = new ObjectMapper();
    String json = objectMapper.writeValueAsString(request);
    StringEntity enitity = new StringEntity(json);
    httpPost.setEntity(entity);
    httpPost.setHeader("JWT-Auth-Token", "{{authToken}}");
    httpPost.setHeader("Content-Type", "application/json");
    client.execute();
    client.close();

Body Parameters

        {
        "botName":"abcxsrs",
        "domainCode":"BK"
        }

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification
Content-Type header application/json true Media type of the resource
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Progress

GET /morfeusadmin/openapi/progress?progressId=201909121603390871

Code Samples

curl -X GET https://morfeusadmin.active.ai/morfeusadmin/openapi/progress?progressId=201909121603390871 \
  -H 'JWT-Auth-Token: {{ auth.token }}' \
GET https://morfeusadmin.active.ai/morfeusadmin/openapi/progress?progressId=201909121603390871 HTTP/1.1
Host: morfeusadmin.active.ai
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : {{ auth.token }}, 
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfeusadmin/openapi/progress?progressId=201909121603390871",
    type: 'GET',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("https://morfeusadmin.active.ai/morfeusadmin/openapi/progress?progressId=201909121603390871");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();
    System.out.println(response.toString());

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Generate Train

POST /morfeusadmin

Code Samples

curl -X POST https://morfeusadmin.active.ai/morfesusadmin \
        -H 'JWT-Auth-Token: {{ auth.token }}', \
        -H 'Accept: application/json' \
    POST https://morfeusadmin.active.ai/morfesusadmin HTTP/1.1
    Host: morfeusadmin.active.ai
    Accept: application/json
    JWT-Auth-Token: {{ auth.token }}
var headers = {
    'Accept':'application/json',
    'JWT-Auth-Token':'{{ auth.token }}'
};

$.ajax({
    url: 'https://morfeusadmin.active.ai/morfesusadmin',
    method: 'post',

    headers: headers,
    success: function(data) {
    console.log(JSON.stringify(data));
        }
}}
String url = "https://morfeusadmin.active.ai/morfesusadmin/";
    RequestObject requestData = {{requestBody}};
    CloseableHttpClient client = HttpClients.createDefault();
    HttpPost httpPost = new HttpPost(url);
    ObjectMapper objectMapper = new ObjectMapper();
    String json = objectMapper.writeValueAsString(requestData);
    StringEntity enitity = new StringEntity(json);
    httpPost.setEntity(entity);
    httpPost.setHeader("Accept", "application/json");
    httpPost.setHeader("JWT-Auth-Token", "{{ auth.token }}");
    client.execute();
    client.close();

Parameters

Parameter In Type Required Description
Accept header application/json true Media Type of the request body to be accepted
JWT-Auth-Token header string true Authentication token for verification

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Download

GET /morfeusadmin/openapi/progress/download?progressId=201909121603390871

Code Samples

curl -X GET https://morfeusadmin.active.ai/morfeusadmin/openapi/progress/download?progressId=201909121603390871 \
  -H 'JWT-Auth-Token: {{ auth.token }}' \
GET https://morfeusadmin.active.ai/morfeusadmin/openapi/progress/download?progressId=201909121603390871 HTTP/1.1
Host: morfeusadmin.active.ai
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfeusadmin/openapi/progress/download?progressId=201909121603390871",
    type: 'GET',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("https://morfeusadmin.active.ai/morfeusadmin/openapi/progress/download?progressId=201909121603390871");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();
    System.out.println(response.toString());

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

FAQ Download

GET /morfeusadmin/openapi/ai/intent/download?botDomainCode=FAQ

Code Samples

curl -X GET https://morfeusadmin.active.ai/morfesusadmin/openapi/ai/intent/download?botDomainCode=FAQ \
    -H 'Content-Type: application/x-www-form-urlencoded'
    -H 'JWT-Auth-Token: {{ auth.token }}' \
GET https://morfeusadmin.active.ai/morfesusadmin/openapi/ai/intent/download?botDomainCode=FAQ HTTP/1.1
Host: morfeusadmin.active.ai
Content-Type: application/x-www-form-urlencoded
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
    'Content-Type': 'application/x-www-form-urlencoded'
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfesusadmin/openapi/ai/intent/download?botDomainCode=FAQ",
    type: 'GET',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("https://morfeusadmin.active.ai/morfesusadmin/openapi/ai/intent/download?botDomainCode=FAQ");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();
    System.out.println(response.toString());

Body Parameters

    [
        {
        "key": "fileUpload",
        "type": "file",
        "src": "../../Downloads/FAQ (1).csv"
        }
    ]

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification
Content-Type header application/x-www-form-urlencoded true Media type of the resource
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK [None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

FAQ Upload

PUT /morfeusadmin/openapi/ai/intent/upload?botDomainCode=FAQ

Code Samples

curl -X PUT https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/intent/upload?botDomainCode=FAQ \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
PUT https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/intent/upload?botDomainCode=FAQ HTTP/1.1
Host: morfeusadmin.active.ai
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/intent/upload?botDomainCode=FAQ",
    type: 'PUT',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/intent/upload?botDomainCode=FAQ");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PUT");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();

Body Parameters

    [
        {
        "key": "",
        "value": "",
        "type": "text",
        "disabled": true
        },
        {
            "key": "fileUpload",
            "type": "file",
            "src": "/Users/activeai/Downloads/FAQ (2).csv"
        }
    ]

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

SmallTalk Download

GET /morfeusadmin/openapi/ai/smallTalk/download

Code Samples

curl -X GET https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/smallTalk/download \
    -H 'Accept: application/octet-stream' \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
GET https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/smallTalk/download HTTP/1.1
Host: morfeusadmin.active.ai
Content-Type: application/x-www-form-urlencoded
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
    'Accept': 'application/octet-stream'
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/smallTalk/download",
    type: 'GET',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/smallTalk/download");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();
    System.out.println(response.toString());

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification
Content-Type header application/octet-stream true Media Type of the resource
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

SmallTalk Upload

PUT /morfeusadmin/openapi/ai/smallTalk/upload

Code Samples

curl -X PUT https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/smallTalk/upload \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
    -H 'Accept' : '*/*' \
PUT https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/smallTalk/upload HTTP/1.1
Host: morfeusadmin.active.ai
Content-Type: application/x-www-form-urlencoded
JWT-Auth-Token: {{ auth.token }}
Accept : */*
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
    'Accept' : '*/*' 
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/smallTalk/upload",
    type: 'GET',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("https://morfeusadmin.active.ai/morfeusadmin/openapi/ai/smallTalk/upload");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PUT");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();

Body Parameters

    [
        {
        "key": "",
        "value": "",
        "type": "text",
        "disabled": true
        },
        {
            "key": "fileUpload",
            "type": "file",
            "src": "../../Downloads/FAQ (2).csv"
        }
    ]

Parameters

Parameter In Type Required Description
Content-Type header /* true Media Type of the resource
JWT-Auth-Token header String true Authentication token for verification
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Generate

POST /morfeusadmin/openapi/bot/ai/config/generate

Code Samples

curl -X POST https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/ai/config/generate \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
    POST https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/ai/config/generate) HTTP/1.1
    JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token':'{{ auth.token }}'
};

$.ajax({
    url: 'https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/ai/config/generate'
    method: 'post',

    headers: headers,
    success: function(data) {
    console.log(JSON.stringify(data));
        }
}};
String url = "https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/ai/config/generate";
    RequestObject requestData = {{requestBody}};
    CloseableHttpClient client = HttpClients.createDefault();
    HttpPost httpPost = new HttpPost(url);
    ObjectMapper objectMapper = new ObjectMapper();
    String json = objectMapper.writeValueAsString(requestData);
    StringEntity enitity = new StringEntity(json);
    httpPost.setEntity(entity);
    httpPost.setHeader("JWT-Auth-Token", "{{ auth.token }}");
    client.execute();
    client.close();

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Template Download

GET /morfeusadmin/openapi/template/download

Code Samples

curl -X GET https://morfeusadmin.active.ai/morfeusadmin/openapi/template/download \
    -H 'Accept: application/octet-stream' \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
GET https://morfeusadmin.active.ai/morfeusadmin/openapi/template/download HTTP/1.1
Host: morfeusadmin.active.ai
Content-Type: application/x-www-form-urlencoded
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
    'Accept': 'application/octet-stream'
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfeusadmin/openapi/template/download",
    type: 'GET',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("https://morfeusadmin.active.ai/morfeusadmin/openapi/template/download");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();
    System.out.println(response.toString());

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification
Content-Type header application/octet-stream true Media Type of the resource
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Template Upload

PUT /morfeusadmin/openapi/template/import/Yes

Code Samples

curl -X PUT  \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
    -H 'Content-Type' : 'multipart/form-data'
PUT  https://morfeusadmin.active.ai/morfeusadmin/openapi/template/import/Yes HTTP/1.1
Host: morfeusadmin.active.ai
Content-Type: multipart/form-data
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
    'Content-Type' : 'multipart/form-data'
};

$.ajax({
    url: " https://morfeusadmin.active.ai/morfeusadmin/openapi/template/import/Yes",
    type: 'PUT',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("[ https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/rules/import](https://morfeusadmin.active.ai/morfeusadmin/openapi/template/import/Yes)");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PUT");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();

Body Parameters

        [
            {
            "key": "fileUpload",
            "type": "file",
            "src": "../../Downloads/Templates (1).json"
            }
        ]

Parameters

Parameter In Type Required Description
Content-Type header multipart/form-data true Media type of the resource
JWT-Auth-Token header String true Authentication token for verification
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Bot Rules Download

GET /morfeusadmin/openapi/bot/rules/bot/download

Code Samples

curl -X GET https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/rules/bot/download \
    -H 'Accept: */*' \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
GET https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/rules/bot/download HTTP/1.1
Host: morfeusadmin.active.ai
Content-Type: application/x-www-form-urlencoded
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
    'Accept': '*/*'
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfeusadmin/openapi/template/download",
    type: 'GET',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/rules/bot/download");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();
    System.out.println(response.toString());

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification
Content-Type header /* true Media type of the resource
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Bot Rule Import

PUT /morfeusadmin/openapi/bot/rules/import

Code Samples

curl -X PUT https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/rules/import \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
    -H 'Accept' : '*/*' \
    -H 'Content-Type' : 'multipart/form-data'
PUT  https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/rules/import HTTP/1.1
Host: morfeusadmin.active.ai
Content-Type: multipart/form-data
Accept : */*
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
    'Accept' : '*/*',
    'Content-Type' : 'multipart/form-data'
};

$.ajax({
    url: " https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/rules/import",
    type: 'PUT',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL(" https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/rules/import");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PUT");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();

Body Parameters

        [
            {
                "key": "fileUpload",
                "type": "file",
                "src": "/../../Downloads/Bot Rules.json"
            },
            {
                "key": "ruleType",
                "value": "bot",
                "type": "text"
            },
            {
                "key": "overwrite",
                "value": "Yes",
                "type": "text"
            }
        ]

Parameters

Parameter In Type Required Description
Content-Type header multipart/form-data true Media type of the resource
Accept header /* true Media type of the resource
JWT-Auth-Token header String true Authentication token for verification
body body RequestObject true 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.

Responses

Status Meaning Description Schema
200 OK OK [None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Create Instance

POST /morfeusadmin/openapi/instance/create

Code Samples

curl -X POST https://morfeusadmin.active.ai/morfeusadmin/openapi/instance/create \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
POST https://morfeusadmin.active.ai/morfeusadmin/openapi/instance/create HTTP/1.1
Host: morfeusadmin.active.ai
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token':'{{ auth.token }}'
};

$.ajax({
    url: 'https://morfeusadmin.active.ai/morfeusadmin/openapi/instance/create',
    method: 'post',

    headers: headers,
    success: function(data) {
    console.log(JSON.stringify(data));
        }
}};
String url = "https://morfeusadmin.active.ai/morfeusadmin/openapi/instance/create";
    RequestObject requestData = {{requestBody}};
    CloseableHttpClient client = HttpClients.createDefault();
    HttpPost httpPost = new HttpPost(url);
    ObjectMapper objectMapper = new ObjectMapper();
    String json = objectMapper.writeValueAsString(requestData);
    StringEntity enitity = new StringEntity(json);
    httpPost.setEntity(entity);
    httpPost.setHeader("JWT-Auth-Token", "{{ auth.token }}");
    client.execute();
    client.close();

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Train status

GET /morfeusadmin/openapi/bot/ai/config/train/status?dataId=315227c7-226a-4215-bab8-6fd3c992c363

Code Samples

curl -X GET https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/ai/config/train/status?dataId=315227c7-226a-4215-bab8-6fd3c992c363 \
    -H 'JWT-Auth-Token: {{ auth.token }}' \
GET https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/ai/config/train/status?dataId=315227c7-226a-4215-bab8-6fd3c992c363 HTTP/1.1
Host: morfeusadmin.active.ai
JWT-Auth-Token: {{ auth.token }}
var headers = {
    'JWT-Auth-Token' : '{{ auth.token }}', 
};

$.ajax({
    url: "https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/ai/config/train/status?dataId=315227c7-226a-4215-bab8-6fd3c992c363",
    type: 'GET',
    success: function(data) {
        console.log(data);
    }
});
    URL obj = new URL("https://morfeusadmin.active.ai/morfeusadmin/openapi/bot/ai/config/train/status?dataId=315227c7-226a-4215-bab8-6fd3c992c363");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
    in.close();
    System.out.println(response.toString());

Parameters

Parameter In Type Required Description
JWT-Auth-Token header string true Authentication token for verification

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Admin Schemas

Get Token Request Object

    {  
    "userId":"<USER_ID>",
    "secretKey":" <SECRET_KEY> ",
    "botCode":" <BOT_CODE> "
    }

Parameters

Parameter Type Required Description
userId string true User Id
secretKey string true Secret Key
botCode string true Bot Code

Create Bot Request Object

    {
    "botName": "<BOT_NAME>",
    "domainCode": "<DOMAIN_CODE>"
    }

Parameters

Parameter Type Required Description
botName string true Bot Name
domainCOde string true Domain Code

FAQ Download Request Object

    [
        {
        "key": "fileUpload",
        "type": "file",
        "src": "/../../Downloads/FAQ (1).csv"
        }
    ]

Parameters

Parameter Type Required Description
key string true Key
type string true Type
src FilePath true Filepath

SmallTalk Upload Request Object

    [
        {
            "key": "fileUpload",
            "type": "file",
            "src": "/../../Downloads/SmallTalk (1).csv"
        },
        {
            "key": "overwrite",
            "value": "Yes",
            "type": "text"
        }
    ]

Parameters

Parameter Type Required Description
key string true Key
type string true Type
src FilePath true Filepath

Template Upload Request Object

    [
        {
        "key": "fileUpload",
        "type": "file",
        "src": "../../Downloads/Templates (1).json"
        }
    ]

Parameters

Parameter Type Required Description
key string true Key
type string true Type
src FilePath true Filepath

Template Download Request Object

Parameters

Parameter Type Required Description
formdata string false formdata

Template Upload Request Object

    [
        {
        "key": "fileUpload",
        "type": "file",
        "src": "../../Downloads/Templates (1).json"
        }
    ]

Parameters

Parameter Type Required Description
key string true Key
type string true Type
src FilePath true Filepath

Bot Rule import Request Object

        [
            {
            "key": "fileUpload",
            "type": "file",
            "src": "/../../Downloads/Bot Rules.json"
            },
            {
            "key": "ruleType",
            "value": "bot",
            "type": "text"
            },
            {
            "key": "overwrite",
            "value": "Yes",
            "type": "text"
            }
        ]

Parameters

Parameter Type Required Description
key string true Key
value string true Value
type string true type
src FilePath true FilePath

Encryption decryption of PII compliance

Encrypt/decrypt Service Request records

API Sample

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

sequence_diagram_morfeus

  1. 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.

  2. 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.

  3. Morfeus would return with a flag and a token to initiate login flow where it identifies login session is required.

  4. 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

sequence_diagram_bot_creation

  1. Call Token API to get the JWT token to call the Bot Management APIs.

  2. 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.

  3. Call Token API again with bot code received from the create Bot API. Use refreshed token for further API calls.

  4. 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.

  5. 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.

  6. 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.

  7. 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 >.

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.

  Login

User Login                                Post

{
  "customerSegments": [
    "string"
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  },
  "user": {
    "address": "string",
    "customerId": "string",
    "customerName": "string",
    "emailId": "string",
    "mobileNumber": "string"
  }
}

Request Parameters

Field Data Type Description
userId string customer's Id
password string customer's password

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
customerSegments string
result object
      message string
      messageCode string
      status 0
user object
      address string customer's address
      customerId string customer's login id
      customerName string customer's name
      emailId string customer's email id
      mobileNumber string customer's mobile number

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

  Customer Profile

Get Customer Profile             Get

URL obj = new URL("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)
public ResponseEntity<CustomerProfileResponse> getCustomerProfile(@PathVariable("customerId") String customerId) {
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());
String customerProfileResponseString = customerProfileResponseMapper.getManipulatedCustomerProfileResponse(response.getBody());
ApplicationLogger.logInfo("Customer Profile Response Body After Transformation :" + response.getBody());
 customerProfileResponse = objectMapper.readValue(customerProfileResponseString, CustomerProfileResponse.class);
}
return ResponseEntity.ok(customerProfileResponse);

Example responses

200 Response

{
  "customerProfile": {
    "address": [
      {
      "addressLine1": "string",
      "addressLine2": "string",
      "addressLine3": "string",
      "addressType": "PRIMARY",
      "city": "string",
      "country": "string",
      "countryCode": "string",
      "province": "string",
      "state": "string"
    }
    ],
    "customerId": 0,
    "customerSegment": "string",
    "firstName": "string",
    "lastName": "string",
    "middleName": "string",
    "DOB":"string",
    "age":"string",
    "gender":"string",
    "updatedDate":"string",
    "updatedBy":"string",
    "createdDate":"string",
    "createdBy":"string",
    "phone": [
      {
        "phoneType": "PRIMARY",
        "phoneCountryCode": "string",
        "phoneNo": 0
      }
    ],
    "email":[
      {
        "emailType":"PRIMARY",
        "emailId":"string"
      }
    ],
    "title": "string",
    "customerProfileUpdationStatus":"string",
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email id
address string customer's address

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
customerProfile object customer's details
      address object customer's address details
            addressLine1 string customer's house no address
            addressLine2 string customer's street address
            addressLine3 string customer's landmark address
           addressType PRIMARY customer's address type
            city string customer's city
            country string customer's country
            countryCode string customer's country code
            province string customer's province
            state string customer's state
      customerId 0 customer's id
      customerSegment string customer's segment
      firstName string customer's firstname
      lastName string customer's lastname
      middleName string customer's middlename
      DOB string customer's date of birth
      age string customer's age
      gender string customer's gender
      updatedDate string customer's profile updation date
      updatedBy string customer's profile updated by
      createdDate string customer's profile creation date
      createdBy string customer's profile created by
      phone Object Array customer's phone details
  phoneCountryCode string customer's phone countrycode
           phoneNo 0 customer's phone number
           phoneType PRIMARY customer's phone type
      email Object Array customer's email address details
            emailType string PRIMARY
            emailId string customer's email id
      title Mr. customer's title
customerProfileUpdationStatus string customer's profile updation status
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Update Customer Email        Put

URL obj = new URL("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)
public ResponseEntity<CustomerProfileResponse> updateCustomerProfileEmail(@PathVariable("customerId") String customerId,
@RequestBody final CustomerProfileRequest customerProfileRequest) {
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());
String customerProfileResponseString = customerProfileResponseMapper.getManipulatedCustomerProfileResponse(response.getBody());
ApplicationLogger.logInfo("Customer Profile Response Body After Transformation :" + response.getBody());
customerProfileResponse = objectMapper.readValue(customerProfileResponseString, CustomerProfileResponse.class);
}
return ResponseEntity.ok(customerProfileResponse);

Example responses

200 Response

{
  "result": {
    "status": 0,
    "message": "message",
    "messageCode": "messageCode"
  },
  "customerProfile": {
    "customerProfileUpdationStatus":"SUCCESS"
}
}

Request URL

Request Parameters

Field Data type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email id
address string customer's address

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
customerProfile object customer's details
      address object customer's address details
            addressLine1 string customer's house no address
            addressLine2 string customer's street address
            addressLine3 string customer's landmark address
           addressType PRIMARY customer's address type
            city string customer's city
            country string customer's country
            countryCode string customer's country code
            province string customer's province
            state string customer's state
      customerId 0 customer's id
      customerSegment string customer's segment
      firstName string customer's firstname
      lastName string customer's lastname
      middleName string customer's middlename
      DOB string customer's date of birth
      age string customer's age
      gender string customer's gender
      updatedDate string customer's profile updation date
      updatedBy string customer's profile updated by
      createdDate string customer's profile creation date
      createdBy string customer's profile created by
      phone Object Array customer's phone details
  phoneCountryCode string customer's phone countrycode
           phoneNo 0 customer's phone number
           phoneType PRIMARY customer's phone type
      email Object Array customer's email address details
            emailType string PRIMARY
            emailId string customer's email id
      title Mr. customer's title
customerProfileUpdationStatus string customer's profile updation status
result object
      status 0
      message message
      messageCode messageCode

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Update Customer Phone       Put

URL obj = new URL("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)
public ResponseEntity<CustomerProfileResponse> updateCustomerProfilePhone(@PathVariable("customerId") String customerId,
@RequestBody final CustomerProfileRequest customerProfileRequest) {
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());
String customerProfileResponseString = customerProfileResponseMapper.getManipulatedCustomerProfileResponse(response.getBody());
ApplicationLogger.logInfo("Customer Profile Response Body After Transformation :" + response.getBody());
customerProfileResponse = objectMapper.readValue(customerProfileResponseString, CustomerProfileResponse.class);
}
return ResponseEntity.ok(customerProfileResponse);

Example responses

200 Response

{
  "result": {
    "status": 0,
    "message": "message",
    "messageCode": "messageCode"
  },
  "customerProfile": {
    "customerProfileUpdationStatus":"SUCCESS"
}
}

Request URL

Request Parameters

Field Data type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email id
address string customer's address

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
customerProfile object customer's details
      address object customer's address details
            addressLine1 string customer's house no address
            addressLine2 string customer's street address
            addressLine3 string customer's landmark address
           addressType PRIMARY customer's address type
            city string customer's city
            country string customer's country
            countryCode string customer's country code
            province string customer's province
            state string customer's state
      customerId 0 customer's id
      customerSegment string customer's segment
      firstName string customer's firstname
      lastName string customer's lastname
      middleName string customer's middlename
      phone Object Array customer's phone details
            phoneCountryCode string customer's phone countrycode
           phoneNo 0 customer's phone number
           phoneType PRIMARY customer's phone type
      title Mr. customer's title
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Update Customer Address    Put

URL obj = new URL("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)
public ResponseEntity<CustomerProfileResponse> updateCustomerProfileAddress(@PathVariable("customerId") String customerId,
@RequestBody final CustomerProfileRequest customerProfileRequest) {
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());
String customerProfileResponseString = customerProfileResponseMapper.getManipulatedCustomerProfileResponse(response.getBody());
ApplicationLogger.logInfo("Customer Profile Response Body After Transformation :" + response.getBody());
customerProfileResponse = objectMapper.readValue(customerProfileResponseString, CustomerProfileResponse.class);
}
return ResponseEntity.ok(customerProfileResponse);

Example responses

200 Response

{
  "result": {
    "status": 0,
    "message": "message",
    "messageCode": "messageCode"
  },
  "customerProfile": {
    "customerProfileUpdationStatus":"SUCCESS"
}
}

Request URL

Request Parameters

Field Data type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email id
address string customer's address

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
customerProfile object customer's details
      address object customer's address details
            addressLine1 string customer's house no address
            addressLine2 string customer's street address
            addressLine3 string customer's landmark address
           addressType PRIMARY customer's address type
            city string customer's city
            country string customer's country
            countryCode string customer's country code
            province string customer's province
            state string customer's state
      customerId 0 customer's id
      customerSegment string customer's segment
      firstName string customer's firstname
      lastName string customer's lastname
      middleName string customer's middlename
      phone Object Array customer's phone details
            phoneCountryCode string customer's phone countrycode
           phoneNo 0 customer's phone number
           phoneType PRIMARY customer's phone type
      title Mr. customer's title
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

  Accounts

Get list of accounts                   Get

URL obj = new URL("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)
public ResponseEntity<AccountsResponse> getCasaAccounts(@PathVariable(name
= "customerId", required = true) String customerId) {
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());
String accountsResponseString = accountsResponseMapper.getManipulatedAccountsResponse(response.getBody());
ApplicationLogger.logInfo("Casa Response Body After Transformation :" + response.getBody());
accountsResponse = objectMapper.readValue(accountsResponseString, AccountsResponse.class);
}
return ResponseEntity.ok(accountsResponse);

Example responses

200 Response

{
  "accounts": [
    {
      "accountId": "string",
      "accountName": "string",
      "accountNumber": "string",
      "balance": {
        "amount": 0,
        "availableBalance": 0,
        "currencyCode": "string",
        "currentBalance": 0
      },
      "bankName": "string",
      "branchAddress": "string",
      "branchId": "string",
      "branchName": "string",
      "category": "string",
      "displayAccountNumber": "string",
      "lastStatementBalance": 0,
      "lastStatementDate": "string",
      "openingDate": "string",
      "product": "string",
      "productCode": "string",
      "status": "ACTIVE",
      "type": "SAVINGS"
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accounts Object Array customer's accounts
     accountId string customer's account id
     accountName string customer's account name
     accountNumber string customer's account number
     balance object customer's account balance
            amount 0 customer's balance amount
        availableBalance 0 customer's available balance
            currencyCode string customer's amount's currency code
          currentBalance 0 customer's current balance
      bankName string customer's bank name
      branchAddress string customer's bank branch address
      branchId string customer's bank branch id
      branchName string customer's bank branch name
      category string customer's account category
displayAccountNumber string customer's account number
lastStatementBalance 0 customer's last statement balance
lastStatementDate string customer's last statement date
      openingDate string customer's account opening date
      product string customer's product
      status ACTIVE customer's status
      type SAVINGS customer's account type
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Account Details                         Get

URL obj = new URL("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)
public ResponseEntity<AccountDetailResponse> getCasaAccountDetail(@PathVariable(name = "customerId", required = true) String customerId,
@PathVariable(name = "accountId", required = true) String accountId) {
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());
String accountDetailResponseString = accountsResponseMapper.getManipulatedAccountDetailsResponse(response.getBody());
ApplicationLogger.logInfo("Casa Account Details Response Body After Transformation :" + response.getBody());
accountDetailsResponse = objectMapper.readValue(accountDetailResponseString, AccountDetailResponse.class);
}
return ResponseEntity.ok(accountDetailsResponse);

Example responses

200 Response

{
  "accountDetail": {
    "accountId": "string",
    "accountName": "string",
    "accountNumber": "string",
    "balance": {
      "amount": 0,
      "availableBalance": 0,
      "currencyCode": "string",
      "currentBalance": 0
    },
    "bankName": "string",
    "branchAddress": "string",
    "branchId": "string",
    "branchName": "string",
    "category": "string",
    "displayAccountNumber": "string",
    "lastStatementBalance": 0,
    "lastStatementDate": "string",
    "openingDate": "string",
    "product": "string",
    "productCode": "string",
    "status": "ACTIVE",
    "type": "SAVINGS"
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id
accountId string customer's account Id

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accountDetail object customer's account details
     accountId string customer's account id
     ifscCode string customer's bank ifsc code
     branchName string customer's bank branch name
     branchAddress string customer's bank branch address
  accountHolderName string customer's name
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Account Balance                       Get

URL obj = new URL("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)
public ResponseEntity<AccountBalanceResponse> getCasaAccountBalance(@PathVariable(name = "customerId", required = true) String customerId,
@PathVariable(name = "accountId", required = true) String accountId) {
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());
String accountDetailResponseString = accountsResponseMapper.getManipulatedAccountsBalanceResponse(response.getBody());
ApplicationLogger.logInfo("Casa Account Balance Response Body After Transformation :" + response.getBody());
accountBalanceResponse = objectMapper.readValue(accountDetailResponseString, AccountBalanceResponse.class);
}
return ResponseEntity.ok(accountBalanceResponse);

Example responses

200 Response

{
  "accountSelected": {
    "accountId": "string",
    "balance":
    {
      "amount": 0,
      "availableBalance": 0,
      "currentBalance": 0,
      "monthlyAverageBalance": 0,
      "currencyCode": "string"
    }
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string
accountId string

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accountSelected object customer's account balance
      accountId string customer's account Id
      balance object customer's balance
           amount string customer's amount currency code
        availableBalance 0 customer's account available balance
        currentBalance 0 customer's account current balance
monthlyAverageBalance 0 customer's monthly average balance
            currencyCode 0 customer's balance currency code
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Account Transactions               Get

URL obj = new URL("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)
public ResponseEntity<AccountTransactionsResponse> getCasaAccountTransactions(
@PathVariable(name = "customerId", required = true) String customerId,
@PathVariable(name = "accountId", required = true) String accountId) {
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());
String accountTransactionsResponseString = accountsResponseMapper.getManipulatedAccountTransactionsResponse(response.getBody());
ApplicationLogger.logInfo("Account Transactions Response Body After Transformation :" + response.getBody());
accountTransactionsResponse = objectMapper.readValue(accountTransactionsResponseString, AccountTransactionsResponse.class);
}
return ResponseEntity.ok(accountTransactionsResponse);

{
  "accountTransactions": [
    {
      "foreignTxnCurrency":"string",
      "amount":0,
      "description":"string",
      "currency":"USD",
      "foreignTxnAmount":0,
      "isDebit":true,
      "cardType":"string",
      "foreignTxnExchangeRate":0,
      "txnDate":"string",
      "referenceId":"string"
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string
accountId string

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accountTransactions object array
      foreignTxnCurrency string customer's foreign transaction currency
      amount 0 customer's transaction amount
      description string customer's transaction description
      currency string customer's transaction currency
      foreignTxnAmount 0 customer's foreign transaction amount
      isDebit true customer's transaction is a debit transaction
      cardType string customer's card category
foreignTxnExchangeRate 0 customer's foreign transaction exchange rate
      txnDate string customer's transaction date
      referenceId string customer's transaction referance id
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Order Check Book                    Post

URL obj = new URL("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) public ResponseEntity<ChequeBookOrderConfirmResponse> confirmChequeBookOrder(
@PathVariable(value = "customerId", required = true) String customerId,
@RequestBody final ChequeBookOrderConfirmRequest chequeBookConfirmRequest) {
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());
String chequeBookOrderConfirmResponseString = accountsResponseMapper.getManipulatedAccountsResponse(response.getBody());
ApplicationLogger.logInfo("Credit Card Limit Confirm Response Body After Transformation :" + response.getBody());
chequeBookOrderConfirmResponse = objectMapper.readValue(chequeBookOrderConfirmResponseString, ChequeBookOrderConfirmResponse.class);
}
return new ResponseEntity<>(chequeBookOrderConfirmResponse, HttpStatus.valueOf(response.getStatus()));

{
"accounts":[
    {
    "transactionStatus" : "SUCCESS",
    "referenceId" : "string"
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email Id
address string customer's address
account object customer's details
   accountId string customer's account Id
   branchId string customer's branch Id
   accountName string customer's account name
   leavesCount string customer's leaves count

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accounts object array
      transactionStatus string customer's ordered cheque book confimation status
      referenceId string customer's ordered cheque book reference Id
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

  Cards

Cards List

   CreditCards List                      Get

URL obj = new URL("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)
  public ResponseEntity<CardsResponse> getCreditCards(@PathVariable(value = "customerId", required = true) String customerId) {
    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());
        String cardsResponseString = cardsResponseMapper.getManipulatedCardsResponse(response.getBody());
        ApplicationLogger.logInfo("Credit Cards Response Body After Transformation :" + response.getBody());
        cardsResponse = objectMapper.readValue(cardsResponseString, CardsResponse.class);
      }
      return new ResponseEntity<>(cardsResponse, HttpStatus.valueOf(response.getStatus()));
/*End of Bank API Integration*/

Response Example

{
  "cards": [
    {
      "accountId": "string",
      "accountNumber": "string",
      "cardNumber":"string",
      "cardIssuer": "string",
      "status": "string",
      "type": "string"
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

No Request Parameters

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cards object array customer's cards
      accountId string customer's account id
      accountNumber string customer's account number
      cardNumber string customer's cardNumber
      cardIssuer string customer's card issuer
      status string customer's card's status
      type string customer's card's type
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

   DebitCards List                       Get

URL obj = new URL("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)
  public ResponseEntity<CardsResponse> getDebitCards(@PathVariable(value = "customerId", required = true) String customerId) {
    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());
        String cardsResponseString = cardsResponseMapper.getManipulatedCardsResponse(response.getBody());
        ApplicationLogger.logInfo("Debit Cards Response Body After Transformation :" + response.getBody());
        cardsResponse = objectMapper.readValue(cardsResponseString, CardsResponse.class);
      }
      return new ResponseEntity<>(cardsResponse, HttpStatus.valueOf(response.getStatus()));
/*End of Bank API Integration*/

Response Example

{
  "cards": [
    {
      "accountId": "string",
      "accountNumber": "string",
      "cardNumber":"string",
      "cardIssuer": "string",
      "status": "string",
      "type": "string"
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

No Request Parameters

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cards object array customer's cards
      accountId string customer's account id
      accountNumber string customer's account number
      cardNumber string customer's cardNumber
      cardIssuer string customer's card issuer
      status string customer's card's status
      type string customer's card's type
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Card Details

    CreditCard Details                 Get

URL obj = new URL("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)
  public ResponseEntity<CardDetailResponse> getCreditCardDetails(@PathVariable(value = "customerId", required = true) String customerId,
      @PathVariable(value = "cardNumber", required = true) String cardNumber) {
    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());
        String cardDetailsResponseString = cardsResponseMapper.getManipulatedCardDetailsResponse(response.getBody());
        ApplicationLogger.logInfo("Credit Card Details Response Body After Transformation :" + response.getBody());
        cardDetailResponse = objectMapper.readValue(cardDetailsResponseString, CardDetailResponse.class);
      }
      return ResponseEntity.ok(cardDetailResponse);
/*End on Bank API Integration*/

Response Example

{
  "cardDetails":{
    "accountId": "string",
    "cardHolderName" : "string",
    "cardIssuer": "string",
    "paymentDueDate": "string"
  },
  "result": {
    "status": 0,
    "message": "string",
    "messageCode": "string"
  }
}

Request URL

Request Parameters

No Request Parameters

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardDetail object
      accountId string customer's account id
      accountName string customer's account name
      accountNumber string customer's account number
      cardHolderName string customer's cardHolderName
      cardIssuer string customer's card issuer
      paymentDueDate string customer's card's payment due date
      status ACTIVE customer's card's status
result
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

    DebitCard Details                  Get

URL obj = new URL("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)
  public ResponseEntity<CardDetailResponse> getDebitCardDetails(@PathVariable(value = "customerId", required = true) String customerId,
      @PathVariable(value = "cardNumber", required = true) String cardNumber) {
    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());
        String cardDetailsResponseString = cardsResponseMapper.getManipulatedCardDetailsResponse(response.getBody());
        ApplicationLogger.logInfo("Debit Card Details Response Body After Transformation :" + response.getBody());
        cardDetailResponse = objectMapper.readValue(cardDetailsResponseString, CardDetailResponse.class);
      }
      return ResponseEntity.ok(cardDetailResponse);
/*End of Bank API Integration*/

Response Example

{
  "cardDetails":{
    "accountId": "string",
    "cardHolderName" : "string",
    "cardIssuer": "string",
    "paymentDueDate": "string"
  },
  "result": {
    "status": 0,
    "message": "string",
    "messageCode": "string"
  }
}

Request URL

Request Parameters

No Request Parameters

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardDetail object
      accountId string customer's account id
      accountName string customer's account name
      accountNumber string customer's account number
      cardHolderName string customer's cardHolderName
      cardIssuer string customer's card issuer
      paymentDueDate string customer's card's payment due date
      status ACTIVE customer's card's status
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Block Card                                Post

URL obj = new URL("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)
  public ResponseEntity<BlockCardResponse> blockCard(@PathVariable(name = "customerId", required = true) String customerId,
      @PathVariable(name = "cardNumber", required = true) String cardNumber, @RequestBody final BlockCardRequest blockCardRequest) {
       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());
        String blockCardResponseString = blockCardResponseMapper.getManipulatedBlockCardResponse(response.getBody());
        ApplicationLogger.logInfo("Block Card Response Body After Transformation :" + response.getBody());
        blockCardResponse = objectMapper.readValue(blockCardResponseString, BlockCardResponse.class);
      }
      return ResponseEntity.ok(blockCardResponse);
/*End of API Integration*/

Request Example

{
  "customerId": "string",
  "customerName": "string",
  "emailId": "string",
  "mobileNumber": "string",
  "cardDetails":{
    "accountNumber":"string",
    "accountId": "string",
    "cardNumber":"string",
    "displayCardNumber":"string",
    "cardType":"string",
    "cardStatus":"string",
    "blockType":"string"
  }
}

Response Example

{
  "cardDetail": {
    "referenceId": "String",
    "transactionStatus": "String"
  },
  "result": {
    "messageCode": "String",
    "message": "String",
    "status": 200
  }
}

Request URL

Request Parameters

Field Data type Description
      customerId String customer's customerId
      customerName String customer's customerName
      mobileNumber String customer's mobileNumber
      emailId String customer's emailId
      address String customer's address
cardDetails
      accountNumber String customer's accountNumber
      accountId String customer's accountId
      cardNumber String customer's card's cardNumber
 displayCardNumber String customer's card's displayCardNumber
      cardName String customer's cardName
      cardType String customer's card's cardType
      cardStatus String customer's card's cardStatus
      blockType String card's blockType

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardDetail
      referenceId String customer's card's referenceId
      transactionStatus string customer's card's transaction Status
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Card Activation                        Post

URL obj = new URL("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)
  public ResponseEntity<ActivationCardResponse> activationCard(@PathVariable(name = "customerId", required = true) String customerId,
      @PathVariable(name = "cardNumber", required = true) String cardNumber, @RequestBody final ActivationCardRequest activationCardRequest) {
    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());
        String activationCardResponseString = activationCardResponseMapper.getManipulatedActivationCardResponse(response.getBody());
        ApplicationLogger.logInfo("Activation Card Response Body After Transformation :" + response.getBody());
        activationCardResponse = objectMapper.readValue(activationCardResponseString, ActivationCardResponse.class);
      }
      return ResponseEntity.ok(activationCardResponse);
/*End of API Integration*/

Request Example

{
  "customerId": "string",
  "customerName": "string",
  "emailId": "string",
  "mobileNumber": "string",
  "cardDetails":{
    "accountNumber":"string",
    "accountId": "string",
    "cardNumber":"string",
    "displayCardNumber":"string",
    "cardType":"string",
    "cardStatus":"string"
  }
}

Response Example

{
  "cardDetail": {
    "referenceId": "String",
    "transactionStatus": "String"
  },
   "result": {
    "messageCode": "String",
    "message": "String",
    "status": 200
  }
}

Request URL

Request Parameters

Field Data type Description
      customerId String customer's customerId
      customerName String customer's customerName
      mobileNumber String customer's mobileNumber
      emailId String customer's emailId
      address String customer's address
cardDetails
      accountNumber String customer's accountNumber
      accountId String customer's accountId
      cardNumber String customer's card's cardNumber
 displayCardNumber String customer's card's displayCardNumber
      cardName String customer's cardName
      cardType String customer's card's cardType
      cardStatus String customer's card's cardStatus

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardDetail
      referenceId String customer's card's referenceId
      transactionStatus string customer's card's transaction Status
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Card Limits

   Credit Card Limits                 Get

URL obj = new URL("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)
  public ResponseEntity<CreditCardLimitResponse> getCreditCardLimits(@PathVariable(value = "customerId", required = true) String customerId,
      @PathVariable(value = "cardNumber", required = true) String cardNumber) {
    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());
                String creditCardLimitResponseString = creditCardResponseMapper.getManipulatedCreditCardLimitResponse(response.getBody());
                ApplicationLogger.logInfo("Credit Card Limit Response Body After Transformation :" + response.getBody());
                creditCardLimitResponse = objectMapper.readValue(creditCardLimitResponseString, CreditCardLimitResponse.class);
            }
            return ResponseEntity.ok(creditCardLimitResponse);
/*End of Bank API Integration*/

Response Example

{
  "card": [
    {
      "cardNumber": 0,
      "domesticATMLimit": 0,
      "domesticPOSLimit": 0,
      "internationalATMLimit": 0,
      "internationalPOSLimit": 0,
      "isInternationalEnabled": true,
      "maxCashLimit": 0,
      "maxCreditLimit": 0,
      "maxDomesticATMLimit": 0,
      "maxDomesticPOSLimit": 0,
      "maxInternationalATMLimit": 0,
      "maxInternationalPOSLimit": 0,
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data type Description
customerId 0 customer's customerId
cardNumber 0 customer's card's cardNumber

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
card object customer's card details
cardNumber 0 customer's cardNumber
domesticATMLimit 0 customer's domesticATMLimit
domesticPOSLimit 0 customer's domesticPOSLimit
internationalATMLimit 0 customer's internationalATMLimit
internationalPOSLimit 0 customer's internationalPOSLimit
isInternationalEnabled Boolean customer's isInternationalEnabled
internationalPOSLimit 0 customer's internationalPOSLimit
maxCreditLimit 0 customer's card's maxCreditLimit
maxCashLimit 0 customer's card's maxCashLimit
maxDomesticATMLimit 0 customer's card's maxDomesticATMLimit
maxDomesticPOSLimit 0 customer's card's maxDomesticPOSLimit
maxInternationalATMLimit 0 customer's card's maxInternationalATMLimit
maxInternationalPOSLimit 0 customer's card's maxInternationalPOSLimit
result object
message string
messageCode string
status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

   Debit Card Limits                  Get

URL obj = new URL("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)
  public ResponseEntity<DebitCardLimitResponse> getDebitCardLimits(@PathVariable(value = "customerId", required = true) String customerId,
      @PathVariable(value = "cardNumber", required = true) String cardNumber) {
    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());
        String debitCardLimitResponseString = debitCardResponseMapper.getManipulatedDebitCardLimitResponse(response.getBody());
        ApplicationLogger.logInfo("Debit Card Limit Response Body After Transformation :" + response.getBody());
        debitCardLimitResponse = objectMapper.readValue(debitCardLimitResponseString, DebitCardLimitResponse.class);
      }
      return ResponseEntity.ok(debitCardLimitResponse);
/*End of Bank API Integration*/

Response Example

{
  "card": [
    {
      "cardNumber": 0,
      "domesticATMLimit": 0,
      "domesticPOSLimit": 0,
      "internationalATMLimit": 0,
      "internationalPOSLimit": 0,
      "isInternationalEnabled": true,
      "maxCashLimit": 0,
      "maxCreditLimit": 0,
      "maxDomesticATMLimit": 0,
      "maxDomesticPOSLimit": 0,
      "maxInternationalATMLimit": 0,
      "maxInternationalPOSLimit": 0,
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data type Description
customerId 0 customer's customerId
cardNumber 0 customer's card's cardNumber

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
card object customer's card details
cardNumber 0 customer's cardNumber
domesticATMLimit 0 customer's domesticATMLimit
domesticPOSLimit 0 customer's domesticPOSLimit
internationalATMLimit 0 customer's internationalATMLimit
internationalPOSLimit 0 customer's internationalPOSLimit
isInternationalEnabled Boolean customer's isInternationalEnabled
internationalPOSLimit 0 customer's internationalPOSLimit
maxCreditLimit 0 customer's card's maxCreditLimit
maxCashLimit 0 customer's card's maxCashLimit
maxDomesticATMLimit 0 customer's card's maxDomesticATMLimit
maxDomesticPOSLimit 0 customer's card's maxDomesticPOSLimit
maxInternationalATMLimit 0 customer's card's maxInternationalATMLimit
maxInternationalPOSLimit 0 customer's card's maxInternationalPOSLimit
result object
message string
messageCode string
status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Limit Update

   Credit Limit Update              Post

URL obj = new URL("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) public ResponseEntity<CreditCardLimitConfirmResponse> confirmCreditCardLimit(
      @PathVariable(value = "customerId", required = true) String customerId,
      @RequestBody final CreditCardLimitConfirmRequest creditCardLimitConfirmRequest) {
    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());
                String creditCardLimitConfirmResponseString = creditCardResponseMapper.getManipulatedCreditCardLimitConfirmResponse(response.getBody());
                ApplicationLogger.logInfo("Credit Card Limit Confirm Response Body After Transformation :" + response.getBody());
                creditCardLimitConfirmResponse = objectMapper.readValue(creditCardLimitConfirmResponseString, CreditCardLimitConfirmResponse.class);
            }
            return new ResponseEntity<>(creditCardLimitConfirmResponse, HttpStatus.valueOf(response.getStatus()));
/*End of Bank API Integration*/

Request Example

{
  "address": "string",
  "customerId": "string",
  "customerName": "string",
  "emailId": "string",
  "mobileNumber": "string",
  "cardDetails": {
    "accountNumber":"string",
    "accountId": "string",
    "cardNumber": "string",
    "cardStatus": "string",
    "cardType": "string",
    "cashLimit": 0,
    "creditLimit": 0,
    "domesticATMLimit": 0,
    "domesticPOSLimit": 0,
    "internationalATMLimit": 0,
    "internationalEnabled": true,
    "internationalPOSLimit": 0,
    "isInternationalEnabled": true,
    "maxCashLimit": 0,
    "maxCreditLimit": 0,
    "maxDomesticATMLimit": 0,
    "maxDomesticPOSLimit": 0,
    "maxInternationalATMLimit": 0,
    "maxInternationalPOSLimit": 0
  }
}

Response Example

{
  "cardDetail": {
    "dailyLimit": 0,
    "overseasDailyLimit": 0,
    "overseasMonthlyLimit": 0,
    "newDomesticATMLimit": 0,
    "newDomesticPOSLimit": 0,
    "newInternationalPOSLimit": 0,
    "newInternationalATMLimit": 0,
    "newCreditLimit": 0,
    "newCashLimit": 0,
    "referenceId": "string",
    "transactionStatus": "string"
  },
  "result": {
    "status": 0,
    "message": "string",
    "messageCode": "string"
  }
}

Request URL

Request Parameters

Field Data type Description
customerId String customer's customerId
customerName String customer's customerName
mobileNumber String customer's mobileNumber
emailId String customer's emailId
address String customer's address
cardDetails
accountNumber String customer's accountNumber
accountId String customer's accountId
cardNumber String customer's card's cardNumber
cardType String customer's card's cardType
cardStatus String customer's card's cardStatus
cashLimit 0 customer's card's cashLimit
creditLimit 0 customer's card's creditLimit
domesticATMLimit 0 customer's card's domesticATMLimit
domesticPOSLimit 0 customer's domesticPOSLimit
internationalATMLimit 0 customer's internationalATMLimit
internationalPOSLimit 0 customer's card's internationalPOSLimit
isInternationalEnabled Boolean customer's card's isInternationalEnabled
maxCashLimit 0 customer's card's maxCashLimit
maxCreditLimit 0 customer's card's maxCreditLimit
maxDomesticATMLimit 0 customer's card's maxDomesticATMLimit
maxDomesticPOSLimit 0 customer's card's maxDomesticPOSLimit
maxInternationalATMLimit 0 customer's card's maxInternationalATMLimit
maxInternationalPOSLimit 0 customer's card's maxInternationalPOSLimit

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardDetail object
dailyLimit 0 customer's card dailyLimit
overseasDailyLimit 0 customer's card overseasDailyLimit
overseasMonthlyLimit 0 customer's card overseasMonthlyLimit
newDomesticATMLimit 0 customer's card newDomesticATMLimit
newDomesticPOSLimit 0 customer's card newDomesticPOSLimit
newInternationalATMLimit 0 customer's card newInternationalATMLimit
newInternationalPOSLimit 0 customer's card newInternationalPOSLimit
newCreditLimit 0 customer's card newCreditLimit
newCashLimit 0 customer's card newCashLimit
referenceId 0 customer's card referenceId
transactionStatus 0 customer's card transactionStatus
result object
message string
messageCode string
status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

   Debit Limit Update               Post

URL obj = new URL("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) public ResponseEntity<DebitCardLimitConfirmResponse> confirmDebitCardLimit(
      @PathVariable(value = "customerId", required = true) String customerId,@PathVariable(value = "cardNumber", required = true) String cardNumber,
      @RequestBody final DebitCardLimitConfirmRequest debitCardLimitConfirmRequest) {
    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());
        String debitCardLimitConfirmResponseString = debitCardResponseMapper.getManipulatedDebitCardLimitConfirmResponse(response.getBody());
        ApplicationLogger.logInfo("Debit Card Limit Confirm Response Body After Transformation :" + response.getBody());
        debitCardLimitConfirmResponse = objectMapper.readValue(debitCardLimitConfirmResponseString, DebitCardLimitConfirmResponse.class);
      }
      return new ResponseEntity<>(debitCardLimitConfirmResponse, HttpStatus.valueOf(response.getStatus()));
/*End of Bank API Integration*/

Request Example

{
  "address": "string",
  "customerId": "string",
  "customerName": "string",
  "emailId": "string",
  "mobileNumber": "string",
  "cardDetails": {
    "accountNumber":"string",
    "accountId": "string",
    "cardNumber": "string",
    "cardStatus": "string",
    "cardType": "string",
    "cashLimit": 0,
    "creditLimit": 0,
    "domesticATMLimit": 0,
    "domesticPOSLimit": 0,
    "internationalATMLimit": 0,
    "internationalEnabled": true,
    "internationalPOSLimit": 0,
    "isInternationalEnabled": true,
    "maxCashLimit": 0,
    "maxCreditLimit": 0,
    "maxDomesticATMLimit": 0,
    "maxDomesticPOSLimit": 0,
    "maxInternationalATMLimit": 0,
    "maxInternationalPOSLimit": 0
  }
}

Response Example

{
  "cardDetail": {
    "dailyLimit": 0,
    "overseasDailyLimit": 0,
    "overseasMonthlyLimit": 0,
    "newDomesticATMLimit": 0,
    "newDomesticPOSLimit": 0,
    "newInternationalPOSLimit": 0,
    "newInternationalATMLimit": 0,
    "newCreditLimit": 0,
    "newCashLimit": 0,
    "referenceId": "string",
    "transactionStatus": "string"
  },
  "result": {
    "status": 0,
    "message": "string",
    "messageCode": "string"
  }
}

Request URL

Request Parameters

Field Data type Description
customerId String customer's customerId
customerName String customer's customerName
mobileNumber String customer's mobileNumber
emailId String customer's emailId
address String customer's address
cardDetails
accountNumber String customer's accountNumber
accountId String customer's accountId
cardNumber String customer's card's cardNumber
cardType String customer's card's cardType
cardStatus String customer's card's cardStatus
cashLimit 0 customer's card's cashLimit
creditLimit 0 customer's card's creditLimit
domesticATMLimit 0 customer's card's domesticATMLimit
domesticPOSLimit 0 customer's domesticPOSLimit
internationalATMLimit 0 customer's internationalATMLimit
internationalPOSLimit 0 customer's card's internationalPOSLimit
isInternationalEnabled Boolean customer's card's isInternationalEnabled
maxCashLimit 0 customer's card's maxCashLimit
maxCreditLimit 0 customer's card's maxCreditLimit
maxDomesticATMLimit 0 customer's card's maxDomesticATMLimit
maxDomesticPOSLimit 0 customer's card's maxDomesticPOSLimit
maxInternationalATMLimit 0 customer's card's maxInternationalATMLimit
maxInternationalPOSLimit 0 customer's card's maxInternationalPOSLimit

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardDetail object
dailyLimit 0 customer's card dailyLimit
overseasDailyLimit 0 customer's card overseasDailyLimit
overseasMonthlyLimit 0 customer's card overseasMonthlyLimit
maxDomesticATMLimit 0 customer's card's maxDomesticATMLimit
maxDomesticPOSLimit 0 customer's card's maxDomesticPOSLimit
maxInternationalATMLimit 0 customer's card's maxInternationalATMLimit
maxInternationalPOSLimit 0 customer's card's maxInternationalPOSLimit
newCreditLimit 0 customer's card newCreditLimit
newCashLimit 0 customer's card newCashLimit
referenceId 0 customer's card referenceId
transactionStatus 0 customer's card transactionStatus
result object
message string
messageCode string
status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

InternationalUsage

    isEnabled                              Post

URL obj = new URL("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)
  public ResponseEntity<InternationalUsageResponse> updateInternationalUsage(@PathVariable(name = "customerId", required = true) String customerId,
      @PathVariable(name = "cardNumber", required = true) String cardNumber, @RequestBody final InternationalCardUsageRequest internationalCardUsageRequest ) {
    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());
        String depositPlanResponseString = cardsResponseMapper.getManipulatedInternationalUsageResponse(response.getBody());
        ApplicationLogger.logInfo("International Usage Response Body After Transformation :" + response.getBody());
        internationalUsageResponse = objectMapper.readValue(depositPlanResponseString, InternationalUsageResponse.class);
      }
      return ResponseEntity.ok(internationalUsageResponse);
/*End of Bank API Integration*/

Request Example

{
  "customerId": "string",
  "customerName": "string",
  "emailId": "string",
  "mobileNumber": "string",
  "cardDetails":{
    "accountNumber":"string",
    "accountId": "string",
    "cardNumber":"string",
    "displayCardNumber":"string",
    "cardType":"string",
    "cardStatus":"string",
    "isInternationalEnabled":true
  }
}

Response Example

{
  "referenceId": "string",
  "transactionStatus": "string",
  "isInternationalEnabled": true,
  "result": {
    "messageCode": "string",
    "message": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data type Description
      customerId String customer's customerId
      customerName String customer's customerName
      mobileNumber String customer's mobileNumber
      emailId String customer's emailId
      address String customer's address
cardDetails
      accountNumber String customer's accountNumber
      accountId String customer's accountId
      cardNumber String customer's card's cardNumber
 displayCardNumber String customer's card's displayCardNumber
      cardName String customer's cardName
      cardType String customer's card's cardType
      cardStatus String customer's card's cardStatus
      isInternationalEnabled Boolean card's isInternationalUsageEnabled

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardDetail
      referenceId String customer's card's referenceId
      transactionStatus string customer's card's transaction Status
  isInternationalEnabled Boolean customer's card's International Usage Enabled
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

    Update                                  Post

URL obj = new URL("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)
  public ResponseEntity<InternationalUsageResponse> updateInternationalUsageFinalApiCall(@PathVariable(name = "customerId", required = true) String customerId,
      @PathVariable(name = "cardNumber", required = true) String cardNumber, @RequestBody final InternationalCardUsageRequest internationalCardUsageRequest ) {
    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());
        String depositPlanResponseString = cardsResponseMapper.getManipulatedInternationalUsageResponse(response.getBody());
        ApplicationLogger.logInfo("International Usage Response Body After Transformation :" + response.getBody());
        internationalUsageResponse = objectMapper.readValue(depositPlanResponseString, InternationalUsageResponse.class);
      }
      return ResponseEntity.ok(internationalUsageResponse);
/*End of Bank API Integration*/

Request Example

{
  "customerId": "string",
  "customerName": "string",
  "emailId": "string",
  "mobileNumber": "string",
  "cardDetails":{
    "accountNumber":"string",
    "accountId": "string",
    "cardNumber":"string",
    "displayCardNumber":"string",
    "cardType":"string",
    "cardStatus":"string",
    "isInternationalEnabled":true
  }
}

Response Example

{
  "referenceId": "string",
  "transactionStatus": "string",
  "result": {
    "messageCode": "string",
    "message": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data type Description
      customerId String customer's customerId
      customerName String customer's customerName
      mobileNumber String customer's mobileNumber
      emailId String customer's emailId
      address String customer's address
cardDetails
      accountNumber String customer's accountNumber
      accountId String customer's accountId
      cardNumber String customer's card's cardNumber
 displayCardNumber String customer's card's displayCardNumber
      cardName String customer's cardName
      cardType String customer's card's cardType
      cardStatus String customer's card's cardStatus

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardDetail
      referenceId String customer's card's referenceId
      transactionStatus string customer's card's transaction Status
  isInternationalEnabled Boolean customer's card's International Usage Enabled
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Replace Card                            Post

URL obj = new URL("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)
  public ResponseEntity<ReplaceCardConfirmResponse> replaceCard(@PathVariable(name = "customerId", required = true) String customerId,
      @PathVariable(name = "cardNumber", required = true) String cardNumber, @RequestBody final ReplaceCardConfirmRequest replaceCardConfirmRequest) {
    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());
        String replaceCardConfirmResponseString = cardsResponseMapper.getManipulatedReplaceCardConfirmResponse(response.getBody());
        ApplicationLogger.logInfo("CardNumber :" + response.getBody());
        replaceCardConfirmResponse = objectMapper.readValue(replaceCardConfirmResponseString, ReplaceCardConfirmResponse.class);
      }
      return new ResponseEntity<>(replaceCardConfirmResponse, HttpStatus.valueOf(response.getStatus()));
/*End of API Integration*/

Request Example

{
  "customerId": "string",
  "customerName": "string",
  "emailId": "string",
  "mobileNumber": "string",
  "cardDetails":{
    "accountNumber":"string",
    "accountId": "string",
    "cardNumber":"string",
    "displayCardNumber":"string",
    "cardType":"string",
    "cardStatus":"string",
    "replaceType":"String",
  }
}

Response Example

{
  "result": {
    "messageCode": "String",
    "message": "String",
    "status": 200
  },
  "cardDetail": {
    "referenceId": "String",
    "transactionStatus": "String"
  }
}

Request URL

Request Parameters

Field Data type Description
      customerId String customer's customerId
      customerName String customer's customerName
      mobileNumber String customer's mobileNumber
      emailId String customer's emailId
      address String customer's address
cardDetails
      accountNumber String customer's accountNumber
      accountId String customer's accountId
      cardNumber String customer's card's cardNumber
 displayCardNumber String customer's card's displayCardNumber
      cardName String customer's cardName
      cardType String customer's card's cardType
      cardStatus String customer's card's cardStatus
      replaceType String card's replaceType

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
result object
      message string
      messageCode string
      status 0
cardDetail
      referenceId String customer's card's referenceId
      transactionStatus string customer's card's transaction Status

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Reset Pin                                   Post

URL obj = new URL("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)
  public ResponseEntity<ResetPinConfirmResponse> resetPin(@PathVariable(name = "customerId", required = true) String customerId,
      @PathVariable(name = "cardNumber", required = true) String cardNumber, @RequestBody final ResetPinConfirmRequest resetPinConfirmRequest) {
    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());
        String resetPinConfirmResponseString = cardsResponseMapper.getManipulatedResetPinConfirmResponse(response.getBody());
        ApplicationLogger.logInfo("Reset Pin Confirm Response Body After Transformation :" + response.getBody());
        resetPinConfirmResponse = objectMapper.readValue(resetPinConfirmResponseString, ResetPinConfirmResponse.class);
      }
      return new ResponseEntity<>(resetPinConfirmResponse, HttpStatus.valueOf(response.getStatus()));
/*End of API Integration*/

Request Example

{
  "customerId": "string",
  "customerName": "string",
  "emailId": "string",
  "mobileNumber": "string",
  "cardDetails":{
    "accountNumber":"string",
    "accountId": "string",
    "cardNumber":"string",
    "displayCardNumber":"string",
    "cardType":"string",
    "cardStatus":"string",
    "inputPin":"String",
  }
}

Response Example

{
  "result": {
    "messageCode": "String",
    "message": "String",
    "status": 200
  },
  "cardDetail": {
    "referenceId": "String",
    "transactionStatus": "String"
  }
}

Request URL

Request Parameters

Field Data type Description
      customerId String customer's customerId
      customerName String customer's customerName
      mobileNumber String customer's mobileNumber
      emailId String customer's emailId
      address String customer's address
cardDetails
      accountNumber String customer's accountNumber
      accountId String customer's accountId
      cardNumber String customer's card's cardNumber
 displayCardNumber String customer's card's displayCardNumber
      cardName String customer's cardName
      cardType String customer's card's cardType
      cardStatus String customer's card's cardStatus
      inputPin String card's inputPin

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
result object
      message string
      messageCode string
      status 0
cardDetail
      referenceId String customer's card's referenceId
      transactionStatus string customer's card's transaction Status

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Card Transactions

   Credit Card Transaction         Get

URL obj = new URL("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) public ResponseEntity<CardTransactionsResponse> getCreditCardTransactions(
      @PathVariable(value = "customerId", required = true) String customerId,
      @PathVariable(value = "cardNumber", required = true) String cardNumber) {
    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());
        String accountTransactionsResponseString = cardsResponseMapper.getManipulatedCardTransactionsResponse(response.getBody());
        ApplicationLogger.logInfo("Credit Card Transactions Response Body After Transformation :" + response.getBody());
        cardTransactionsResponse = objectMapper.readValue(accountTransactionsResponseString, CardTransactionsResponse.class);
      }
      return ResponseEntity.ok(cardTransactionsResponse);
/*End of Bank API Integration*/

Response Example

{
   "cardTransactions":[
      {
         "transactionId": "string",
         "accountId": "string",
         "accountNumber": "string",
         "foreignTxnCurrency":"string",
         "amount":0.00,
         "description":"string",
         "currency":"string",
         "foreignTxnAmount":0.00,
         "transactionType": "string",
         "cardType":"string",
         "foreignTxnExchangeRate":0.00,
         "txnDate":"string",
         "referenceId":"string",
         "categoryType": "string",
         "categorySubType": "string",
         "merchantName": "string"
      }
   ],
   "result":{
      "messageCode":"string",
      "message":"string",
      "status":0
   }
}

Request URL

Request Parameters

Field Data type Description
customerId 0 customer's customerId
cardNumber 0 customer's card's cardNumber

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardTransactions object customer's card's transactions
      transactionId String customer's transactionId
      accountId String customer's accountId
      accountNumber String customer's accountNumber
      foreignTxnCurrency string customer's card's foreign transaction currency
      description string customer's card's transaction description
      currency string customer's card's transaction currency
      foreignTxnAmount 0 customer's card's foreign transaction amount
      amount 0 customer's card's transaction amount
      transactionType String customer's transactionType
      cardType String customer's cardType
  foreignTxnExchangeRate 0 customer's card's foreign transaction exchange rate
      txnDate string customer's card's transaction date
      referenceId string customer's card's transaction refernce id
      category string customer's card's transaction category
      categorySubType string customer's card's transaction subcategoryType
      currency string customer's card's transaction currency
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

   Debit Card Transaction          Get

URL obj = new URL("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) public ResponseEntity<CardTransactionsResponse> getDebitCardTransactions(
      @PathVariable(value = "customerId", required = true) String customerId,
      @PathVariable(value = "cardNumber", required = true) String cardNumber) {
    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());
        String accountTransactionsResponseString = cardsResponseMapper.getManipulatedCardTransactionsResponse(response.getBody());
        ApplicationLogger.logInfo("Credit Card Transactions Response Body After Transformation :" + response.getBody());
        cardTransactionsResponse = objectMapper.readValue(accountTransactionsResponseString, CardTransactionsResponse.class);
      }
      return ResponseEntity.ok(cardTransactionsResponse);
/*End of Bank API Integration*/

Response Example

{
   "cardTransactions":[
      {
         "transactionId": "string",
         "accountId": "string",
         "accountNumber": "string",
         "foreignTxnCurrency":"string",
         "amount":0.00,
         "description":"string",
         "currency":"string",
         "foreignTxnAmount":0.00,
         "transactionType": "string",
         "cardType":"string",
         "foreignTxnExchangeRate":0.00,
         "txnDate":"string",
         "referenceId":"string",
         "categoryType": "string",
         "categorySubType": "string",
         "merchantName": "string"
      }
   ],
   "result":{
      "messageCode":"string",
      "message":"string",
      "status":0
   }
}

Request URL

Request Parameters

Field Data type Description
customerId 0 customer's customerId
cardNumber 0 customer's card's cardNumber

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardTransactions object customer's card's transactions
      transactionId String customer's transactionId
      accountId String customer's accountId
      accountNumber String customer's accountNumber
      foreignTxnCurrency string customer's card's foreign transaction currency
      description string customer's card's transaction description
      currency string customer's card's transaction currency
      foreignTxnAmount 0 customer's card's foreign transaction amount
      amount 0 customer's card's transaction amount
      transactionType String customer's transactionType
      cardType String customer's cardType
  foreignTxnExchangeRate 0 customer's card's foreign transaction exchange rate
      txnDate string customer's card's transaction date
      referenceId string customer's card's transaction refernce id
      category string customer's card's transaction category
      categorySubType string customer's card's transaction subcategoryType
      currency string customer's card's transaction currency
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Convert to Installments

   Credit Card Conversion         Get

URL obj = new URL("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)
  public ResponseEntity<ConvertEMIResponse> convertEMI(@PathVariable(name = "customerId", required = true) String customerId,
      @PathVariable(name = "cardNumber", required = true) String cardNumber) {
    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());
        String convertEMIResponseString = cardsResponseMapper.getManipulatedConvertEMICreditCardConfirmResponse(response.getBody());
        ApplicationLogger.logInfo("Convert EMI Response Body After Transformation :" + response.getBody());
        convertEMIResponse = objectMapper.readValue(convertEMIResponseString, ConvertEMIResponse.class);
      }
      return new ResponseEntity<>(convertEMIResponse, HttpStatus.valueOf(response.getStatus()));
/*End of Bank API Integration*/

Response Example

{
  "listofEMIPlan": [
    {
      "amount": {
        "amount": 0.00,
        "amountFormatted": "string",
        "currency": "string"
      },
      "emiAmount": {
        "amount": 0.00,
        "amountFormatted": "string",
        "currency": "string"
      },
      "processingFee": {
        "amount": 0.00,
        "amountFormatted": "string",
        "currency": "string"
      },
      "gst": {
        "amount": 0.00,
        "amountFormatted": "string",
        "currency": "string"
      },
      "interestRate": "string",
      "tenure": {
        "years": "0",
        "months": "0",
        "days": "0",
        "tenureFormatted": "string"
      },
      "totalAmount": {
        "amount": 0.00,
        "amountFormatted": "string",
        "currency": "string"
      },
      "transactionSerialNumber": "string"
    }
  ],
  "result": {
    "status": 200,
    "message": "string",
    "messageCode": "string"
  }
}

Request URL

Request Parameters

No Request Parameters

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
listofEMIPlan
   amount
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   emiAmount
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   processingFee
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   gst
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   totalAmount
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   interestRate String amount's interestRate
   tenure
      years String years
      months String amount's months
      days String amount's days
      tenureFormatted String amount's tenureFormatted
   interestRate String amount's interestRate
   transactionSerialNumber String customer's transactionSerialNumber
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Installments Update

   CreditCard                             Post

URL obj = new URL("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)
  public ResponseEntity<ConvertEMICreditCardConfirmResponse> convertEMICreditCard(@PathVariable(name = "customerId", required = true) String customerId,
      @PathVariable(name = "cardNumber", required = true) String cardNumber, @RequestBody final ConvertEMICreditCardConfirmRequest convertEMICreditCardConfirmRequest) {
    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());
        String convertEMICreditCardConfirmResponseString = cardsResponseMapper.getManipulatedConvertEMICreditCardConfirmResponse(response.getBody());
        ApplicationLogger.logInfo("Convert EMI Confirm Response Body After Transformation :" + response.getBody());
        convertEMICreditCardConfirmResponse = objectMapper.readValue(convertEMICreditCardConfirmResponseString, ConvertEMICreditCardConfirmResponse.class);
      }
      return new ResponseEntity<>(convertEMICreditCardConfirmResponse, HttpStatus.valueOf(response.getStatus()));
/*End of Bank API Integration*/

Request Example

{
  "customerId": "string",
  "customerName": "string",
  "emailId": "string",
  "mobileNumber": "string",
  "cardDetails":{
    "accountNumber":"string",
    "accountId": "string",
    "cardNumber":"string",
    "displayCardNumber":"string",
    "cardType":"string",
    "cardStatus":"string",
  },
  "selectedEMIPlan": {
    "amount": {
      "amount": 0.00,
      "amountFormatted": "string",
      "currency": "string"
    },
    "emiAmount": {
      "amount": 0.00,
      "amountFormatted": "string",
      "currency": "string"
    },
    "processingFee": {
      "amount": 0.00,
      "amountFormatted": "string",
      "currency": "string"
    },
    "gst": {
      "amount": 0.00,
      "amountFormatted": "string",
      "currency": "string"
    },
    "interestRate": "string",
    "tenure": {
      "years": "0",
      "months": "0",
      "days": "0",
      "tenureFormatted": "string"
    },
    "totalAmount": {
      "amount": 0.00,
      "amountFormatted": "string",
      "currency": "string"
    },
    "transactionSerialNumber": "string"
  }
}

Response Example

{
  "cardDetail": {
    "referenceId": "String",
    "transactionStatus": "String"
  },
  "result": {
    "messageCode": "String",
    "message": "String",
    "status": 200
  }
}

Request URL

Request Parameters

Field Data type Description
      customerId String customer's customerId
      customerName String customer's customerName
      mobileNumber String customer's mobileNumber
      emailId String customer's emailId
      address String customer's address
cardDetails
      accountNumber String customer's accountNumber
      accountId String customer's accountId
      cardNumber String customer's card's cardNumber
 displayCardNumber String customer's card's displayCardNumber
      cardName String customer's cardName
      cardType String customer's card's cardType
      cardStatus String customer's card's cardStatus
selectedEMIPlan
   amount
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   emiAmount
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   processingFee
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   gst
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   totalAmount
      amount String amount
      amountFormatted String amount's amountFormatted
      currency String amount's currency
   interestRate String amount's interestRate
   tenure
      years String years
      months String amount's months
      days String amount's days
      tenureFormatted String amount's tenureFormatted
   interestRate String amount's interestRate
   transactionSerialNumber String customer's transactionSerialNumber

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
cardDetail
      referenceId String customer's card's referenceId
      transactionStatus string customer's card's transaction Status
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

  Loan              

Get list of loan accounts     Get

URL obj = new URL("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)
public ResponseEntity<LoanAccountsResponse> getLoanAccounts(@PathVariable(name = "customerId", required = true) String customerId) { 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());
String accountsResponseString = accountsResponseMapper.getManipulatedAccountsResponse(response.getBody());
ApplicationLogger.logInfo(" Loan Response Body After Transformation :" + response.getBody());
loanAccountsResponse = objectMapper.readValue(accountsResponseString, LoanAccountsResponse.class);
}
return ResponseEntity.ok(loanAccountsResponse);

Example responses

200 Response

{
  "loanAccounts": [
    {
      "accountId": "string",
      "accountName": "string",
      "accountNumber": "string",
      "balance": {
        "amount": 0,
        "availableBalance": 0,
        "currencyCode": "string",
        "currentBalance": 0
      },
      "bankName": "string",
      "branchAddress": "string",
      "branchId": "string",
      "branchName": "string",
      "category": "string",
      "displayAccountNumber": "string",
      "lastStatementBalance": 0,
      "lastStatementDate": "string",
      "openingDate": "string",
      "product": "string",
      "productCode": "string",
      "status": "ACTIVE",
      "type": "LOAN",
      "originalPrincipalAmount": 0,
      "emiPaymentMethod": "string",
      "originalClosingDate": "string",
      "loanFundingDate": "string",
      "interestCalculationDate": "string",
      "interestRate": "string",
      "tenorTerm": 0,
      "tenorPeriod": "string",
      "maturityDate": "string",
      "interestAnnualPercentageRate": "string"
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accounts Object Array customer's accounts
     accountId string customer's account id
     accountName string customer's account name
     accountNumber string customer's account number
      balance object customer's account balance
            amount 0 customer's balance amount
            availableBalance 0 customer's available balance
            currencyCode string customer's amount's currency code
            currentBalance 0 customer's current balance
      bankName string customer's bank name
      branchAddress string customer's bank branch address
      branchId string customer's bank branch id
      branchName string customer's bank branch name
      category string customer's account category
      displayAccountNumber string customer's account number
      lastStatementBalance 0 customer's last statement balance
      lastStatementDate string customer's last statement date
      openingDate string customer's account opening date
      product string customer's ----
      status ACTIVE customer's status
      type LOAN customer's account type
      originalPrincipalAmount 0 customer's principle amount
     emiPaymentMethod string customer's emi payment method
      originalClosingDate string customer's loan closing date
      loanFundingDate string customer's loan funding date
     interestCalculationDate string customer's loan's interest calculation date
      interestRate 0 customer's loan interest rate
      tenorTerm 0 customer's loan tenor time
      tenorPeriod string customer's loan tenor period
      maturityDate string customer's loan maturity date
interestAnnualPercentageRate string customer's loan annual interest percentage rate
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Loan Account Details          Get

URL obj = new URL("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)
public ResponseEntity<LoanAccountDetailResponse> getLoanAccountDetail(@PathVariable(name = "customerId", required = true) String customerId,
 @PathVariable(name = "accountId", required = true) String accountId) {
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());
String accountDetailResponseString = accountsResponseMapper.getManipulatedAccountDetailsResponse(response.getBody());
ApplicationLogger.logInfo("Loan Account Details Response Body After Transformation :" + response.getBody());
loanAccountDetailResponse = objectMapper.readValue(accountDetailResponseString, LoanAccountDetailResponse.class);
}
return ResponseEntity.ok(loanAccountDetailResponse);

Example responses

200 Response

{
  "accountDetails": {
    "accountId": "string",
    "ifscCode": "string",
    "branchName": "string",
    "branchAddress": "string",
    "accountHolderName": "string"
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string
accountId string

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accountDetail object customer's account details
     accountId string customer's account id
     accountName string customer's account name
      ifscCode string customer's bank account number
      branchName string customer's bank branch name
      branchAddress string customer's bank branch address
accountHolderName string customer's name
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Loan Account Balance        Get

URL obj = new URL("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)
public ResponseEntity<LoanAccountBalanceResponse> getLoanAccountBalance(@PathVariable(name = "customerId", required = true) String customerId,
@PathVariable(name = "accountId", required = true) String accountId) {
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());
String accountDetailResponseString = accountsResponseMapper.getManipulatedAccountsBalanceResponse(response.getBody());
ApplicationLogger.logInfo("Loan Account Balance Response Body After Transformation :" + response.getBody());
loanAccountBalanceResponse = objectMapper.readValue(accountDetailResponseString, LoanAccountBalanceResponse.class);
}
return ResponseEntity.ok(loanAccountBalanceResponse);

Example responses

200 Response

{
  "accountBalance": {
    "amount": 0,
    "availableBalance": 0,
    "currencyCode": "string",
    "currentBalance": 0
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string
accountId string

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accountBalance object customer's account balance
      amount 0 customer's balance amount
      availableBalance 0 customer's available balance
      currencyCode string customer's amount currency code
      currentBalance 0 customer's account current balance
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

  Deposit         

Get list of deposit accounts     Get

URL obj = new URL("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)
public ResponseEntity<DepositAccountsResponse> getDepositAccounts(@PathVariable(name = "customerId", required = true) String customerId) {
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());
String accountsResponseString = accountsResponseMapper.getManipulatedAccountsResponse(response.getBody());
ApplicationLogger.logInfo(" Deposit Response Body After Transformation :" + response.getBody());
depositAccountsResponse = objectMapper.readValue(accountsResponseString, DepositAccountsResponse.class);
}
return ResponseEntity.ok(depositAccountsResponse);

Example responses

200 Response

{
  "depositAccounts": [
    {
      "accountId": "string",
      "bankName":"string",
      "accountName": "string",
      "accountNumber": "string",
      "balance": {
        "amount": 0,
        "availableBalance": 0,
        "currencyCode": "string",
        "currentBalance": 0
      },
      "bankName": "string",
      "branchAddress": "string",
      "branchId": "string",
      "branchName": "string",
      "category": "string",
      "ifscCode":"string",
      "displayAccountNumber": "string",
      "lastStatementBalance": 0,
      "lastStatementDate": "string",
      "openingDate": "string",
      "product": "string",
      "productCode": "string",
      "status": "ACTIVE",
      "accountType": "DEPOSIT",
      "accountHolderName":"string",
      "earlyWithdrawalFee":"string",
      "earlyWithdrawalAmount":"string",
      "maturityDate":"string",
      "maturityAmount":"string",
      "maturityInstruction":"string",
      "initialPrincipalAmount":"string",
      "interestRate":"string",
      "tenorTerm":"string",
      "tenorPeriod":"string",
      "totalInterestAmountEarned":"string",
      "lastRenewalDate":"string",
      "depositName":"string"

    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accounts Object Array customer's accounts
     accountId string customer's account id
     accountName string customer's account name
     accountNumber string customer's account number
     balance object customer's account balance
            amount 0 customer's balance amount
            availableBalance 0 customer's available balance
            currencyCode string customer's amount's currency code
            currentBalance 0 customer's current balance
      bankName string customer's bank name
      branchAddress string customer's bank branch address
      branchId string customer's bank branch id
      branchName string customer's bank branch name
      category string customer's account category
      displayAccountNumber string customer's account number
      lastStatementBalance 0 customer's last statement balance
      lastStatementDate string customer's last statement date
      openingDate string customer's account opening date
      product string customer's account product name
      status ACTIVE customer's status
      type DEPOSIT customer's account type
  accountHolderName string customer's name
    earlyWithdrawalFee 0 customer's deposit accounts early withdrawl fee
    earlyWithdrawalAmount 0 customer's deposit accounts early withdrawl amount
      maturityDate string customer's deposit account maturity date
      maturityAmount 0 customer's deposit account maturity amount
      maturityInstruction string customer's deposit account maturity instruction
      initialPrincipalAmount 0 customer's deposit account initial principle amount
      interestRate string customer's deposit account interest rate
      tenorTerm 0 customer's deposit account tenor term
      tenorPeriod string customer's deposit account tenor period
totalInterestAmountEarned 0 customer's deposit account total interest amount earned
      lastRenewalDate string customer's deposit account last renewal date
      depositName string customer's name
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Deposit Account Details          Get

URL obj = new URL("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)
public ResponseEntity<DepositAccountDetailResponse> getDepositAccountDetail(@PathVariable(name = "customerId", required = true) String customerId,
@PathVariable(name = "accountId", required = true) String accountId) {
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());
String accountDetailResponseString = accountsResponseMapper.getManipulatedAccountDetailsResponse(response.getBody());
ApplicationLogger.logInfo("Deposit Account Details Response Body After Transformation :" + response.getBody());
depositAccountDetailResponse = objectMapper.readValue(accountDetailResponseString, DepositAccountDetailResponse.class);
}
return ResponseEntity.ok(depositAccountDetailResponse);

Example responses

200 Response

{
  "accountDetails": {
    "accountId": "string",
    "ifscCode": "string",
    "branchName": "string",
    "branchAddress": "string",
    "accountHolderName": "string"
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string
accountId string

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accountDetail object customer's account details
     accountId string customer's account id
     accountName string customer's account name
      ifscCode string customer's bank account number
      branchName string customer's bank branch name
      branchAddress string customer's bank branch address
accountHolderName string customer's name
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Deposit Account Balance        Get

URL obj = new URL("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)
public ResponseEntity<DepositAccountBalanceResponse> getDepositAccountBalance(@PathVariable(name = "customerId", required = true) String customerId,
@PathVariable(name = "accountId", required = true) String accountId) {
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());
String accountDetailResponseString = accountsResponseMapper.getManipulatedAccountsBalanceResponse(response.getBody());
ApplicationLogger.logInfo("Deposit Account Balance Response Body After Transformation :" + response.getBody());
depositAccountBalanceResponse = objectMapper.readValue(accountDetailResponseString, DepositAccountBalanceResponse.class);
}
return ResponseEntity.ok(depositAccountBalanceResponse);

Example responses

200 Response

{
  "accountBalance": {
    "amount": 0,
    "availableBalance": 0,
    "currencyCode": "string",
    "currentBalance": 0
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string
accountId string

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
accountBalance object customer's account balance
      amount 0 customer's balance amount
      availableBalance 0 customer's available balance
      currencyCode string customer's amount currency code
      currentBalance 0 customer's account current balance
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Open Certificate of Deposit

    Deposit Plans                        Post

URL obj = new URL("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)
public ResponseEntity<DepositServiceResponse> getDepositPlans(@PathVariable(name = "customerId", required = true) String customerId,@RequestBody final DepositServiceRequest depositServiceRequest) {
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());
String depositPlanResponseString = depositPlanResponseMapper.getManipulatedDepositPlanResponse(response.getBody());
ApplicationLogger.logInfo("Deposit Plan Response Body After Transformation :" + response.getBody());
depositServiceResponse = objectMapper.readValue(depositPlanResponseString, DepositServiceResponse.class);
}
return ResponseEntity.ok(depositServiceResponse);

Example responses

200 Response

{
  "depositPlans": [
    {
      "amount": 0,
      "tenure": {
        "years": "string",
        "months": "string",
        "days": "string",
        "tenureFormatted": "string"
      },
      "interestRate": "string.",
      "maturityAmount": 0
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email Id
address string customer's address
depositPlans object array
    amount string customer's fixed deposit amount
    interestRate string customer's fixed deposit interest rate
    maturityAmount string customer's fixed deposit maturity amount
debitableAccounts object array
    accountId string customer's fixed deposit debitable account Id
    accountHolderName string customer's name
    branchId string customer's branch Id
    branchName string customer's branch name

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
depositPlans object array
      amount 0 customer's fixed deposit amount
      tenure object
            years string customer's fixed deposit tenure year
            months string customer's fixed deposit tenure month
            days string customer's fixed deposit tenure days
            tenureFormatted string customer's fixed deposit tenure formatted
      interestRate string customer's fixed deposit interest rate
      maturityAmount 0 customer's fixed deposit maturity amount
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

    Deposit Nominees                Post

URL obj = new URL("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)
public ResponseEntity<DepositServiceResponse> getDepositPlanNominees(@PathVariable(name = "customerId", required = true) String customerId,@RequestBody final DepositServiceRequest depositServiceRequest) {
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());
String nomineesResponseString = depositPlanResponseMapper.getManipulatedNomineeResponse(response.getBody());
ApplicationLogger.logInfo("Nominee Response Body After Transformation :" + response.getBody());
depositServiceResponse = objectMapper.readValue(nomineesResponseString, DepositServiceResponse.class);
}
return ResponseEntity.ok(depositServiceResponse);

Example responses

200 Response

{
  "depositPlans": {
    "nominee": {
    "nomineeName": "string",
    "nomineeAddress": "string",
    "nomineeRelationship": "string",
    "minor": false,
    "guardian": "string"
  }
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email Id
address string customer's address
depositPlans object array
    amount string customer's fixed deposit amount
    interestRate string customer's fixed deposit interest rate
    maturityAmount string customer's fixed deposit maturity amount
debitableAccounts object array
    accountId string customer's fixed deposit debitable account Id
    accountHolderName string customer's name
    branchId string customer's branch Id
    branchName string customer's branch name

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
depositPlans object array
      nominee object
        nomineeName string customer's fixed deposit nominee name
      nomineeAddress string customer's fixed deposit nominee address
  nomineeRelationship string customer's relationship with nominee
            minor 0 whether nominee is a minor
            guardian 0 minor nominees guadian
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

    Confirm Deposit                   Post

URL obj = new URL("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)
public ResponseEntity<DepositServiceResponse> getDepositPlanFinalResponse(@PathVariable(name = "customerId", required = true) String customerId,@RequestBody final DepositServiceRequest depositServiceRequest) {
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());
String depositPlanFinalAPiCallResponseString = depositPlanResponseMapper.getManipulatedDepositPlanFinalApiCallResponse(response.getBody());
ApplicationLogger.logInfo("Deposit Plan Final API Response Body After Transformation :" + response.getBody());
depositServiceResponse = objectMapper.readValue(depositPlanFinalAPiCallResponseString, DepositServiceResponse.class);
}
return ResponseEntity.ok(depositServiceResponse);

Example responses

200 Response

{
  "depositPlans": {
    "status": "SUCCESS",
    "FDAccountId": "987654323011"
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email Id
address string customer's address
depositPlans object array
    amount string customer's fixed deposit amount
    interestRate string customer's fixed deposit interest rate
    maturityAmount string customer's fixed deposit maturity amount
debitableAccounts object array
    accountId string customer's fixed deposit debitable account Id
    accountHolderName string customer's name
    branchId string customer's branch Id
    branchName string customer's branch name

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
depositPlans object array
      FDAccountId string customer's fixed deposit refernce Id
      status string customer's fixed deposit status
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Close Certificate of Deposit

    Confirm Deposit                   Post

URL obj = new URL("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)
public ResponseEntity<DepositServiceResponse> getDepositPlanFinalResponse(@PathVariable(name = "customerId", required = true) String customerId,@RequestBody final DepositServiceRequest depositServiceRequest) {
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());
String depositPlanFinalAPiCallResponseString = depositPlanResponseMapper.getManipulatedDepositPlanFinalApiCallResponse(response.getBody());
ApplicationLogger.logInfo("Deposit Plan Final API Response Body After Transformation :" + response.getBody());
depositServiceResponse = objectMapper.readValue(depositPlanFinalAPiCallResponseString, DepositServiceResponse.class);
}
return ResponseEntity.ok(depositServiceResponse);

Example responses

200 Response

{
  "depositPlans": {
    "status": "SUCCESS",
    "FDAccountId": "987654323011"
  },
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email Id
address string customer's address
depositPlans object array
    amount string customer's fixed deposit amount
    interestRate string customer's fixed deposit interest rate
    maturityAmount string customer's fixed deposit maturity amount
debitableAccounts object array
    accountId string customer's fixed deposit debitable account Id
    accountHolderName string customer's name
    branchId string customer's branch Id
    branchName string customer's branch name

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
depositPlans object array
      FDAccountId string customer's fixed deposit refernce Id
      status string customer's fixed deposit status
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

  Transfer

Confirm Transfer                   Post

URL obj = new URL("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)
public ResponseEntity<FundTransferResponse> confirmTransfer(@PathVariable(value = "customerId", required = true) Integer customerId,
@RequestBody final FundTransferRequest fundTransferRequest) {
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());
String ConfirmTransferResponseString = fundTransferResponseMapper.getManipulatedFundTransferResponse(response.getBody());
ApplicationLogger.logInfo("Confirm Transfer Response Body After Transformation :" + response.getBody());
fundTransferResponse = objectMapper.readValue(ConfirmTransferResponseString, FundTransferResponse.class);
}
return ResponseEntity.ok(fundTransferResponse);


Example responses

200 Response

{
  "txnReferenceId":"string",
  "transactionStatus":"string",
  "transactionFee":0,
  "transferAmount":0,
  "isChargeTransactionFee":false,
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email Id
address string customer's address
type string payee's transaction type
payeeType string payee's type
amount string payee's transaction amount
payeeId string payee's Id
payeeAccountId string payee's account Id
payeeBankId string payee's bank Id
purpose string payee's transaction purpose

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
transactionStatus SUCCESS customer's card's transaction status
txnReferenceId string customer's card's transaction reference id
transactionFee 0 Transaction fee
transferAmount 0 Amount need to be transfered
isChargeTransactionFee boolean transaction fee is applicable or not
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Payee List                              Post

URL obj = new URL("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)
public ResponseEntity<PayeesResponse> getPayeesList(@Valid @RequestBody final PayeesRequest payeeRequest,@PathVariable(value = "customerId", required = true) Integer customerId) {
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());
 String payeesResponseString = fundTransferResponseMapper.getManipulatedPayeesResponse(response.getBody());
ApplicationLogger.logInfo("Payees Response Body After Transformation :" + response.getBody());
payeeResponse = objectMapper.readValue(payeesResponseString, PayeesResponse.class);
}
return ResponseEntity.ok(payeeResponse);

Example responses

200 Response

{
    "payees": [
        {
            "payeeId": "string",
            "payeeName": "string",
            "payeeNickName": "string",
            "payeeType": "string",
            "payeeAccountNo": "string",
            "payeeMaskedAccountNo": "string",
            "payeeAccountId": "string",
            "currency": "USD",
            "status": "ACTIVE",
            "payeeBank": "string",
            "ifscCode": "string",
            "payeeBankBranch": "string",
            "payeeBankIFSC": "string",
            "payeeBankSWIFT": "string"
        }
    ],
     "result": {
        "messageCode": "string",
        "message": "string",
        "status": 0
    },
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id
customerName string customer's name
mobileNumber string customer's mobile number
emailId string customer's email Id
address string customer's address
payeeId string payee's Id
payeeName string payee's name
payeeBankId string payee's bank Id
payeeAccountNo string payee's account number
payeeBankIFSC string payee's bank ifsc code
accountIds array

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
payeeDetails object array payee details
      currency string payment currency
      payeeAccountId string payee's account id
      payeeAccountNo string payee's account number
      payeeBank string payee's bank
      payeeBankBranch string payee's bank branch
      payeeBankIFSC string payee's bank ifsc code
      payeeBankSWIFT string payee's bank swift
      payeeId string payee's id
payeeMaskedAccountNo string payee's masked account number
      payeeName string payee's name
      payeeNickName string payee's nick name
      payeeType string payee's type
      status string payee's status
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

  Bill Payment

Biller list                                Get

URL obj = new URL("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)
public ResponseEntity<BillerResponse> getRegisteredBillerListForCustomer(@PathVariable(name = "customerId", required = true) String customerId) {
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());
String billerResponseString = billpaymentResponseMapper.getManipulatedRegisteredBillerResponse(response.getBody());
ApplicationLogger.logInfo("Registered Billers Response Body After Transformation :" + response.getBody());
billerResponse = objectMapper.readValue(billerResponseString, BillerResponse.class);
}
return new ResponseEntity<>(billerResponse, HttpStatus.valueOf(response.getStatus()));

Example responses

200 Response

{
   "billers": [
    {
      "billerId": "string",
      "billerCategoryId": "string",
      "billerType": "string",
      "partialPayment": "string",
      "billerName":"string",
      "billerCategory":"string",
      "billDate":"string",
      "billDueDate":"string",
      "billNumber":"string",
      "dueAmount":0,
      "lastStatementBalance":0
    }
   ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
billers object array list of billers
      allowPartialPay true allow partial payment
      billerId string biller's id
      billerCategoryId string biller's category Id
      billerType string biller's type
      partialPayment string partial payment is allowed or not
      billerName string biller's name
      billerCategory string biller's category
      billDate string bill date
      billDueDate string bill payment due date
      billNumber string bill number
      dueAmount 0 bill due amount
 lastStatementBalance 0 bill last statement balance
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Biller Details                         Get

URL obj = new URL("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)
public ResponseEntity<BillerResponse> getBillerDetialsofBiller(@PathVariable(name = "customerId", required = true) String customerId,@PathVariable(name = "billerId", required = true) String billerId) {
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());
String billerDetailsResponseString = billpaymentResponseMapper.getManipulatedBillerDetailsResponse(response.getBody());
ApplicationLogger.logInfo("Biller Details Response Body After Transformation :" + response.getBody());
billerDetailsResponse = objectMapper.readValue(billerDetailsResponseString, BillerResponse.class);
}
return new ResponseEntity<>(billerDetailsResponse, HttpStatus.valueOf(response.getStatus()));

Example responses

200 Response

{
  "billers": [
    {
      "dueAmount": 0,
      "billDate": "string",
      "billDueDate": "string",
      "lastStatementBalance": 0,
      "payWithOutBill" : "string"
    }
  ],
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data Type Description
customerId string customer's Id
billerId string biller's Id

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
billers object array
      dueAmount 0 bill due amount
      billDate string bill date
      billDueDate string bill payment due date
lastStatementBalance 0 bill last statement balance
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Confirm Bill Payment           Post

URL obj = new URL("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)
  public ResponseEntity<BillPaymentResponse> confirmBillPayment(@PathVariable(value = "customerId", required = true) String customerId,
  @RequetBody final BillPaymentRequest billPaymentRequest) {
    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());
 String billPaymentResponseString = billpaymentResponseMapper.getManipulatedBillPaymentResponse(response.getBody());
ApplicationLogger.logInfo("Bill Payment Confirm Response Body After Transformation :" + response.getBody());
billPaymentResponse = objectMapper.readValue(billPaymentResponseString, BillPaymentResponse.class);
}
return new ResponseEntity<>(billPaymentResponse, HttpStatus.valueOf(response.getStatus()));

Example responses

200 Response

{
  "billerName": "string",
  "transactionStatus": "string",
  "pooledPayeeAccNumber": "string",
  "billDeskTransactionId": "string",
  "txnReferenceId": "string",
  "result": {
    "message": "string",
    "messageCode": "string",
    "status": 0
  }
}

Request URL

Request Parameters

Field Data type Description
billers object array list of billers
      allowPartialPay true allow partial payment
      billerId string biller's id
      billerCategoryId string biller's category Id
      billerType string biller's type
      partialPayment string partial payment is allowed or not
      billerName string biller's name
      billerCategory string biller's category
      billDate string bill date
      billDueDate string bill payment due date
      billNumber string bill number
      dueAmount 0 bill due amount
lastStatementBalance 0 bill last statement balance

Success Responses

Status Meaning Description Schema
200 OK OK ResponseObject

Response Parameter

Field Data type Description
      billerName string biller's name
      transactionStatus string bill payment status
pooledPayeeAccNumber string payee's account number
billDeskTransactionId string bill payment desk transaction Id
      txnReferenceId string bill payment transaction reference Id
result object
      message string
      messageCode string
      status 0

Error Responses

Status Meaning Description Schema
400 Bad Request Bad Request None
401 Unauthorized Unauthorized None
404 Not Found Not Found None