First API Call
Step 1: Retrieve Authorization Token
Refer to Authentication and retrieve your API authentication token by passing the user credentials to the OAuth0 authorization URL at https://stage-api.credilinq.ai/v1/auth/generate-token
Here is how a token is generated.
curl --request POST \
--url https://stage-api.credilinq.ai/v1/auth/generate-token \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"client_id": "2Hancbwhybyfy2nusfbuwbuwb",
"client_secret": "y6tydyy-swfnv34-fnjjnve_eknk"
}
'
The above request generates a token as follows.
{
"statusCode": 200,
"data": {
"access_token": "eyJraWQiOiJ3YitJMjNzOWRCNUh0cjBhQXVwTHVjeFwvUFhWREhlVEcyQWpTNnkyNFBjYz0iLCJhbGciOiJSUzI1NiJ9",
"scope": "<scope>",
"expires_in": 600000,
"token_type": "Bearer"
},
"message": "Success",
"success": true
}
Step 2: Consume Endpoint
Below is a sample URL with the appropriate authorization code and body.
curl --request POST \
--url https://stage-api.credilinq.ai/v1/loan/calculateloanschedule \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiJ3YitJMjNzOWRCNUh0cjBhQXVwTHVjeFwvUFhWREhlVEcyQWpTNnkyNFBjYz0iLCJhbGciOiJSUzI1NiJ9' \
--data '
{
"customerReferenceNo": "Test Reference Number",
"loanAmount": 2000,
"loanTermFrequency": 30
}
'
This request is responded to by a 200
Response Code with the following JSON.
{
"statusCode": 200,
"data": {
"customerReferenceNo": "Test Reference Number",
"loanTermFrequency": 30,
"totalDueAmount": 2000,
"loanDueDate": "2023-04-03T01:45:41.595Z",
"disbursalAmount": 2000,
"chargesApplied": 50,
"totalRepaymentExpected": 2000
},
"message": "Success",
"success": true
}
Updated almost 2 years ago