Embeddable IBV Report

NinjaEdge has a feature called Embeddable Report, which enables users of the Loan Management System (LMS) to access IBV reports directly within the LMS user interface. This IBV report is hosted on the NinjaEdge platform and can be embedded via an iframe. The Embeddable Reports feature is designed to provide a seamless and secure experience for LMS users when interacting with their customers' IBV data.

Step 1: Generate Access Token

To embed a NinjaEdge report within the Loan Management System using an iframe, a temporary access token is required. The Loan Management System can acquire a temporary access token by calling the /auth/tokens API endpoint. It is important to note that the access token has a 30-minute expiration period. After this period, the user must refresh the page to obtain a new token and re-display the report.

Request

POST https://ninjafetch.com/api/v1/auth/tokens

Headers

NameDescriptionExampleRequired
x-api-keyA unique key issued during onboarding6rprzP8q6b7ulYcLsKz2Yes

Body

KeyDescriptionExampleRequired
product_request_idA unique identifier of the product request. It is provided by NinjaEdge through a webhook or API.IBV420CE406A15E1ABF3B43Yes
typeType of token that will be generated. Must be "embedded_report_token" for embedding reports.embedded_report_tokenYes

Example

curl --location 'https://ninjafetch.com/api/v1/auth/tokens' \
--header 'x-api-key: 575abdebc559433afe6d1e37708342fd8456c' \
--header 'Content-Type: application/json' \
--data '{
    "product_request_id": "IBVE3F79627D808246EAB09",
    "type": "embedded_report_token"
}'

Response

a) Access Token Issued - HTTP 200

NameDescriptionExampleType
access_tokenA valid access tokeneyJhbGciOiJIUzI1NiJ9String
expires_inThe length of time in seconds that the access token is valid for. Default is 1800 for embedded report tokens.1800String

b) Bad Request - HTTP 400

NameDescriptionExampleType
messageThe details of the failureInvalid credentialsString
fieldsProvides a detailed error message for each invalid field{...}Object

c) Unauthorized - HTTP 401

NameDescriptionExampleType
errorThe details of the failureInvalid credentialsString

Examples for status code

{  
  "access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRGIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36P6yJV_adQssw5c",  
  "expires_in"1800  
}
{
    "message": "Validation error",
    "fields": {
        "product_request_id": [
            "is required for generation of embedded report token"
        ]
    }
}
{
    "error": "Invalid token"
}

Step 2: Embed report into iframe

After acquiring the token in step 1, the Loan Management System should append it to the end of the Embeddable Report URL to create a link and use it in an iframe. By rendering the IBV report within the existing user interface, users can easily access critical information.

<iframe src="https://ninjafetch.com/portal/embeddable_reports?token=YOUR_TOKEN">