Portal API
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.
API Host
The API host is dependent on your account region.
Region | API URL |
Singapore | https://portalapi.leadsquared.com/ |
United States | https://portalapi-us11.leadsquared.com/ |
India (Mumbai) | https://portalapi-in21.leadsquared.com/ |
India (Hyderabad) | https://portalapi-in22.leadsquared.com/ |
Ireland | https://portalapi-ir31.leadsquared.com/ |
Canada | https://portalapi-ca12.leadsquared.com/ |
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
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.
Note:
- 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.
DateTime Format
The supported DateTime format for all LeadSquared APIs is UTC (YYYY-MM-DD HH:MM:SS). For e.g., the date 26th March, 2016, 02:15 PM will be formatted as “2016-03-26 14:15:00” in UTC. DateTime data passed in any other format may cause errors.
Forms and Processes
The LeadSquared Forms and Process designer lets you create dynamic forms and string together entire application processes. 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 support@leadsquared.com to get them enabled for your account.
Embedding Processes
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
- Register
- Sign-In with Password
- Get Sign-In OTP
- Sign-In with OTP
- Forgot Password
- Reset Password
- Change Password