LeadSquared API returns synchronous responses by default. We also offer Asynchronous (Async) API for even better reliability and performance. In addition, by using asynchronous responses, your implementation can do other tasks while LeadSquared is retrieving your data.
Whether the LeadSquared core platform is up or down, Async APIs will guarantee near-zero leakage for all requests*. Requests will be accepted, processed, and also retried up to 10 times.
Peak Usage Protection
Async APIs can manage any load, even when called with large volumes, the API requests will still be accepted.
* Our API Gateway is hosted on AWS (Amazon Web Service Cloud) which guarantees an availability SLA of 99.95%. There may be instances where requests are not received by LeadSquared. If you face any such issues, please contact us at firstname.lastname@example.org.
When should I use LeadSquared’s Async API?
- The primary use case for Async API is when you don’t have a re-try mechanism to send leads, opportunities, and activities to LeadSquared.
- Typically, the integration is done directly from a web application or website, where there is no retry possibility and a quick response to the end-user is necessary, and rate limits should not impact the end-user (your customers).
Can I use Async API for high throughput API calls?
No, Async API is not built for high throughput API calls. If very high throughput is sent to Async APIs, it will end up in long delays. For high throughput, there is no alternative to using bulk APIs and queuing at your end.
Is Async API processing speed unlimited and auto-scalable?
No, processing speed is limited and fixed at a cap. Async API processing cannot auto-scale due to inevitable DB limitations.
How It Works
Async APIs are a wrapper over our V2 APIs that ensure queuing and retry as needed. Requests are first queued and later picked for processing. Requests that fail for non-application reasons are retried.
- Retries are only performed for non-application errors (system errors like ‘Unable to Connect to DB). Application errors (like validation errors and other exceptions starting with ‘MX’) are not retried.
- Processing speed is limited and is fixed at a cap. Async API processing cannot auto-scale due to inevitable DB limitations.
Retry is performed a maximum of 10 times at the following intervals –
- 1st Retry – 30s
- 2nd Retry – 2m
- 3rd Retry – 7m
- 4th Retry – 15m
- 5th Retry – 30m
- 6th Retry – 45m
- 7th Retry – 60m
- 8th Retry – 1.5h
- 9th Retry – 2h
- 10th Retry – 3h
When you make a call using Async API, instead of the actual response data, a
RequestId is returned in the response.
- Pass the
RequestIdin the query string of the Status API*.
- The response will return the status of the request –
- If successful, the actual response data will be returned
- If unsuccessful, the response returns details on the status, reason, and steps.
* There are different Status APIs available for different Async APIs. For example. the Capture Leads API
v2/LeadManagement.svc/Lead.Capture? has the following Status API endpoint
API Host and Key
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.
To find your API host and
- Log in to your LeadSquared account and navigate to My Profile>Settings>API and Webhooks>Async API.
- Alongside Enable Async API, click Yes.
- Your API host and Key will both be visible on the page.
Authentication for Async APIs requires you to pass the following –
SecretKeymust be passed in the query string
x-api-keymust be passed in the header
- The Status API doesn’t require
- For all other requests, you must pass valid access and secret keys associated with your LeadSquared.
Async APIs are free from rate limits. The rate limits specified for other v2 APIs do not apply to Async APIs.
However, requests are internally processed as per our capabilities. In case of sudden spikes, a slight backlog can be expected.
List of APIs
- Capture Leads (Async) | Capture Leads Status API | Get Capture Leads Metrics
- Update a Lead (Async) | Update a Lead Status API | Get Update Lead Metrics
- Post an Activity on a Lead (Async) | Post an Activity on a Lead Status API | Get Post Activity on Lead Metrics
- Create a Lead and Activity (Async) | Create Lead and Activity Status API | Get Create Lead and Activity Metrics
- Capture Opportunities (Async) | Capture Opportunities Status API | Get Capture Opportunities Metrics
- Update an Opportunity (Async) | Update an Opportunity Status API | Get Update Opportunity Metrics
- Post a Call Log (Async) | Post a Call Log Status API | Get Post Call Log Metrics