Using the API 

 

Import the Postman Collection to be able to fetch your instance and request a decision.  

IMPORTANT: Please make sure your Postman Environment is setup with Globals and Locals. 

 

Importing the Collection by selecting Import in the “My workspace” header.  

  Select the file from the location on your device and Import the Collection.  


IMPORTANT: All the Elements will be imported during this process.
  

A screenshot of a computer

Description automatically generated 

 Authentication


Authentication involves sending a verified username and password with your request. In the request Authorisation tab, select Bearer Token from the Type dropdown list. 

Enter your Connect API username and password in the Username and Password fields. For extra security, store these in variables.
  

Example below: 

  1. Click on the “Authenticate” tab and perform the below checks before you hit the “Send” the request for successful authentication: 
  1. Authorization: 
  1. Type – Bearer Token 
  2. Token – {{token}}     
  1. Body: 

    "username": "",        [Connect API Username] 

    "password": ""         [Connect API Password] 

  1. Tests:  

var jsonData = JSON.parse(responseBody); 

pm.globals.set("token", jsonData.token);
  

  1. Once the above checks are complete, hit the “Send” button to generate your token. 

 

Graphical user interface, text

Description automatically generated


If the token is expired, user would need to reauthenticate themselves. The token lasts for a specific period before needing to be refreshed on the same endpoint.

 


Fetch your Decision Configuration 

 

GET methods are typically for retrieving data from our Connect API. We will be able to retrieve all the instances via Get Instances request.

 

Select the guid ID from the Get Instances.

Now, navigate to Get Instance Configuration request and you will need to pass the GUID parameters as Path Variables.

 


Click on the “Send” button to fetch your Instance configuration.   



Decision Making 


1. Click on the “Connect - Decision Making tab and perform the below checks before you hit the “Send” request to make the decision.
 

  1. Params – add a new key called companyId : pass the company id on which you wanted to request decision.  
  1. add a new key called guid – pass the guid that we have got from the response on GET method for your instance.
  2. Body – Add the Body as below (ignore if already available) 

 "creditAmount": "This is the user input that we have to pass while requesting for decision" 


2.  Once the above checks are complete, hit the “Send” request to request for decision and you will have the JSON response that has individual outcome of the checks and the final outcome (Decision). 


IMPORTANT: Please note that the final outcome will be the highest risk value out of all the checks made. The Decision Text will be empty if the final outcome is Accept.  

 

Instance Configuration

 

Get Instance

 

This endpoint is used to get the configuration details of the instance.

  1. The user needs to generate the token by following the steps mentioned in ‘Authentication’. 

URL: https://connect.creditsafe.com/v1/authenticate


A screenshot of a computer

Description automatically generated

  1. Perform a GET Instance Configuration by passing the guid as Path Variables.

Headers: Pass Token


Query Params: Not Applicable


URL: https://connect.creditsafe.com/v1/decisionEngine/instance/:guid

 A screenshot of a computer

Description automatically generated

  1. Click on ‘Send’ to retrieve the Instance configuration.

 

  1. Users should get the configuration details successfully with Status code 200 as shown below.

A screenshot of a computer program

Description automatically generated


Update Instance

 

This end point is used to update the configuration of the configured decision tree. By using this end point we can enable/disable metrics from a configuration, update the threshold values, change the Failed statuses, Unavailable statuses, update the Published key, and update the decision tree name.

Note 1: Users cannot make any updates to the readOnly key and customerId. 


Note 2: Users must perform a GET instance configuration before making any changes to the Instance configuration. By doing this, users can always view the current configuration details before they perform an update.

  1. Users can copy the response JSON of the GET Instance configuration.

2.  Provide the JSON Configuration of the instance generated through the GET request into the 'Body'.

 

Headers: Pass Token


Query Params: Not Applicable


URL: https://connect.creditsafe.com/v1/decisionEngine/instance/:guid

A screenshot of a computer

Description automatically generated

3. Users can update the configuration details as per the requirements.

 4. Change the Method from ‘GET’ to ‘PUT’

A screenshot of a computer program

Description automatically generated

5. Once users have updated the ‘Body’, they can hit ‘Send’ to update the configuration.

6. Successfully updated configurations will show a Status code 200 as well as the updated configuration body.

A screenshot of a computer program

Description automatically generated

7. When a user executes a GET request using the same GUID, they should observe the updated configuration information.  

Decision Outcomes and Decision Descriptions

 

Get Decision Outcome values and Decision Descriptions

 

This endpoint is used to get the decision outcome and the decision description details of the instance.

  1. The user needs to generate the token by following the steps mentioned in ‘Authentication’. 

URL: https://connect.creditsafe.com/v1/authenticate

  1. Perform a GET decision outcome by passing the guid as Path Variables.

Headers: Pass Token


Query Params: Not Applicable


URL: https://connect.creditsafe.com/v1/decisionEngine/decisionOutcome/:guid


3. Click on ‘Send’ to retrieve the Instance configuration.

4. User should retrieve the decision outcome and decision description details for the guid successfully.

 

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

Update Decision Outcome values and Decision Descriptions

 

This end point is used to customize the decision outcome values, decision outcome descriptions for various status codes and restrict the manual review process for the selected guid i.e., by updating the value of ‘includeInManualReview’ key. The value defined for the ‘includeInManualReview’ key will determine whether the manual review process will be applicable or restricted for the guid when the decision outcome comes as ‘status: 2’.

  1. Users can copy the response JSON of the GET Decision outcome.

 

2. Provide the JSON Configuration of the instance generated through the GET request into the 'Body'.


Headers: Pass Token


Query Params: Not Applicable


URL: https://connect.creditsafe.com/v1/decisionEngine/decisionOutcome/:guid


3. Users can customize the decision outcome values, decision outcome descriptions and the value of the ‘includeInManualReview’ key as per the requirements.

 

4. Change the Method from ‘GET’ to ‘PATCH’

 

A screenshot of a computer program

Description automatically generated

 

 

5. Once users have updated the details, they can hit ‘Send’ to perform a PATCH operation. Users must be able to see successful message with Status code 200 as shown below:



6. When a user performs a GET on the same guid, they must view the updated decision outcome details.


A screenshot of a computer

Description automatically generated

 

 

Updated GUID List Endpoint 

 

  1. A new key ‘decisionOutcome’ is added to the GUID list endpoint. This newly introduced key will be available only for the for type = ‘CS Decision Module’.

Headers: Pass Token


Query Params: Pass ‘decisionOutcome’ key as ‘true’


URL: https://connect.creditsafe.com/v1/decisionEngine/GUID?decisionOutcome=true


A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated


View Updated Instance Log History

 

User will be able to view any changes to the decision tree in terms of Configuration changes or any update made to the Decision outcome values and decision outcome descriptions. The Tree Configuration logs capture the history for any changes made to the Decision values and Decision descriptions for a decision tree.

  1. The user needs to generate the token by following the steps mentioned in ‘Authentication’. 


URL: https://connect.creditsafe.com/v1/authenticate


A screenshot of a computer

Description automatically generated

Instance Log History for Configuration updates/Decision outcome updates

 

2. Perform a GET instance log by passing the guid as Query Variables.


Headers: Pass Token


Query Params: Pass guide


URL: https://connect.creditsafe.com/v1/decisionEngine/instanceLog?guid=


A screenshot of a computer

Description automatically generated

Decision Outcome label updated 

A screenshot of a computer program

Description automatically generated

Decision outcome description updated 

 

A screenshot of a computer

Description automatically generated

New Metric Added – ‘isRequired’ key updated from ‘False’ to ‘true’ 

A screenshot of a computer

Description automatically generated

New Metric Added – Threshold updated from ‘-‘ to ‘new value’