LeadSquared’s Portal APIs give you the core functionality required to build your own portal for capturing leads (e.g., financial/education/medical application portals). These include APIs that facilitate lead registration, sign-in and forgot/change/reset password functionality.
In conjunction with these APIs, you can export the custom forms in your LeadSquared application and use them to capture lead data directly from your portal to your account.
The API host is dependent on your account region.
Note: You must use the correct API host to make successful calls. If you use an incorrect host you’ll get a ‘401 Unauthorized’ error. The correct API host will be mentioned in the error message.
Authentication for Portal APIs requires a public authentication key.
- To generate the public authentication key, call the Get Public Auth Key API and pass your LeadSquared Access Key and Secret Key in the query string.
- In all calls you make using Portal APIs, you must pass the public authentication key as an HTTP Header.
- The only exception is Change Password API which requires a private authentication key. This key gets generated when you successfully sign-in using the Sign-In API.
- You must be an administrator of your LeadSquared account. API calls will fail if you pass the access and secret keys associated with any other user role.
- You must also pass the registration token in the header of the Register User API.
Forms and Processes
The LeadSquared Forms and Process designer lets you create dynamic forms and string together entire application processes. These forms can be embedded in your portal’s webpages so you can directly capture lead information to your LeadSquared account. In addition, you can embed an entire process into your portal through the process designer.
Note: These features are not available by default. Contact us at firstname.lastname@example.org to get them enabled for your account.
The first step is to export a published form to HTML.
- In your LeadSquared account, on the main menu, navigate to Workflow>Manage Forms.
- Alongside any published form, hover your cursor over the settingsicon, then click Export Form HTML.
You can then copy the form HTML and paste it in your webpage based on your customization requirements.
Here’s an example of a LeadSquared form embedded in a sample education application portal –
You can embed published processes from the process designer into your portal.
All forms that are part of the process will be embedded into your webpage(s) along with the process logic. You don’t need to embed any forms separately.
- In your LeadSquared account, on the main menu, navigate to Workflow>Process Designer.
- Click Create Process, then click At Specific Work Area.
- On the pop-up, under Available Work Areas, click Customer Portal, then select the checkbox under Web.
- Click Save when you’re done.
Note: You can also edit an existing process and perform steps 3 and 4.
Now continue to build your process and publish it (for more information, see How to Create a Process). Edit the process in live edit mode, and click the code snippet icon on the top left side of the page (alongside the process name) –
Copy the process HTML and paste it in your webpage based on your customization requirements.
List of APIs
Here’s the list of APIs that are currently available –
- Get Public Auth Key
- Get Portal Registration Token
- Sign-In with Password
- Get Sign-In OTP
- Sign-In with OTP
- Forgot Password
- Reset Password
- Change Password