API – Customer-Facing Website Dedicated Login Page

General

Through the API you can easily create a dedicated login page or add a login area to an existing website.

How To

To log the user into the customer-facing website, first send the user credentials to the following endpoint:

https://loanpro.simnang.com/api/public/api/1/tenants({tenantId})/customers/authenticate

The payload should look something like this:

{
username: _username,
password: _password,
logout: _website

}

The username and password properties are necessary for the user to log in. The logout property lets you choose where the user should be redirected to when they log out of your website.

LoanPro will respond with the following payload:

{
"d": {
"id": "1",
"type": "customer.type.individual",
"name": "John Kennedy",
"sessionId": "jg0m2sls65lm58FdrR5q3sb625",
"postLoginPage": "postLogin.php?
u=eyJpZCI6IjEiLCJ0eXBlIjoi58efTE4d8udHlwZS5pbmRpdmlkdWFsIiwibmFtZSI6Im9zY2FyIEY0IEtlbm5lZHkiLCJzZXNzaW9uSWQiOiJqZzBtMnNsczY1bG0waHRzN2I3cTNzYjYyNSJ9"
}
}

You must then redirect the user to the customer-facing website by creating a URL using the postLoginPage URL added to the base URL for your customer-facing website. If the base URL for your customer-facing website is yourcompany.loanpro.software, the URL will look something like this: yourcompany.loanpro.software/postLogin.php?u=eyJpZCI6IjEiLCJ0eXBlIjoi58efTE4d8udHlwZS5pbmR

pdmlkdWFsIiwibmFtZSI6Im9zY2FyIEY0IEtlbm5lZHkiLCJzZXNzaW9uSWQiOiJqZzBtMnNsczY1bG0waHRzN2I3cTNzYjYyNSJ9.

Redirecting the user to this URL will take them to the post-login view of the customer-facing website.

StackBlitz Example

Many of our articles use StackBlitz examples like this. These examples are like a window into a REST client right here in your browser. The window is divided into two sides. Developers can use info in the editor on the left side when configuring your API integration, and the right side shows a preview of a REST client. Click 'Preview' on the bottom, and you'll only see the REST client.

The entire request is set up and connected to a demo API tenant in LMS. Just scroll down and click 'send' and you should get a 200 response. If you want to get some practice with error codes, try editing the endpoint, headers, method and payload to see what responses you get.


How did we do?


Powered by HelpDocs (opens in a new tab)