Connect LeadSquared
You need a LeadSquared administrator: the keys are an administrator's (LeadSquared's opportunity search answers no one else), and the opportunity fields are added in Settings. It takes about fifteen minutes, most of it adding fields.
Get API keys
- In LeadSquared, My Profile → Settings → API and Webhooks. Copy the Access Key and the Secret Key, and note the API host shown on that page.
- In CoSell, Settings → CRM → LeadSquared, choose that API host, paste the keys and press Connect LeadSquared.
The host depends on where LeadSquared keeps your account:
| Region | API host |
|---|---|
| Singapore | https://api.leadsquared.com |
| India (Mumbai) | https://api-in21.leadsquared.com |
| India (Hyderabad) | https://api-in22.leadsquared.com |
| United States | https://api-us11.leadsquared.com |
| Canada | https://api-ca12.leadsquared.com |
| Ireland | https://api-ir31.leadsquared.com |
| Middle East | https://api-me61.leadsquared.com |
CoSell sends the keys as request headers over TLS, never in an address, and stores them encrypted. The keys act as the user they belong to and stop working when that user is deactivated, so use a user who stays. To end access, disconnect LeadSquared in CoSell or deactivate that user.
Add the opportunity fields by hand
LeadSquared has no API for adding a field to an opportunity, and it numbers the fields an administrator adds
(mx_Custom_21, mx_Custom_22, …): you choose a field's display name, not its schema name. So activation lists
what is missing instead of creating it, and CoSell finds each field by its display name.
Under My Profile → Settings → Opportunities → Opportunity Types, edit the opportunity type CoSell works with and, on Field Configuration, press Add Field for each of these (type String), with exactly these display names:
ACE Opportunity ID, ACE Partner Central URL, ACE Review Status, ACE Review Comments, ACE Stage,
ACE Origin, ACE AWS Seller, ACE Engagement Score, ACE Involvement Type, ACE Sync Status,
ACE Last Synced At, ACE Sync Error, ACE Expected Spend, ACE Marketplace Offers.
Add one more, ACE Co Sell, as a Dropdown with the options Yes and No (LeadSquared opportunities have
no checkbox): sellers set it to Yes to mark an opportunity for AWS. Put it on the opportunity form.
Then press Re-activate in CoSell; the connection goes clean once every field is found. Capitals, spaces and
underscores do not matter (ACE_Opportunity_ID is found too). A field you leave out is simply not written.
Prefer your own names, or have such fields already? Open the opportunity type's Edit page, read each field's
schema name there (mx_Custom_N) and enter it under CoSell's Settings → Mapping → Write-back fields, then
re-activate.
LeadSquared says how many characters each field holds (200 for a text field in its own examples): CoSell cuts longer text, such as a long review comment or a sync error, to fit.
The AWS inputs the default mapping reads are found the same way, by display name: AWS Use Case,
AWS Delivery Model, AWS Primary Needs, AWS Sales Activities, Customer AWS Account ID, Competitor,
Next Step and Type. Add the ones sellers fill, or map your own fields by schema name under Settings → Mapping.
How LeadSquared's objects map
| In CoSell | In LeadSquared |
|---|---|
| Opportunities | Opportunities of one opportunity type: the one with the lowest code (12000 in LeadSquared's examples). The name, stage, expected deal size and expected closure date are the type's standard fields; CoSell sets the status (Open, Won, Lost) the stage belongs to |
| Accounts | Accounts of the Customers account type. The Accounts feature is switched on by LeadSquared support; without it CoSell cannot read a customer's company |
| Contacts | Leads (a LeadSquared lead is a person). A lead belongs to an account, and an opportunity's account is its lead's |
| Leads | Leads; converting one makes (or joins) the account, adds the opportunity to the lead and moves the lead to the Customer stage |
Things to know:
- Stages are yours. LeadSquared's stage names (its examples show Prospecting, Qualification, Need Analysis, Proposal, Negotiation and Closed - Won) are not the ones CoSell's mapping starts with: map the names you use to AWS stages, and choose the stage from which a deal is sent, under Settings → Mapping → Stages.
- Notes sit on the lead. A note CoSell adds to an opportunity appears on its lead, and CoSell reads the lead's notes for the opportunity.
- Every opportunity needs a lead. CoSell cannot create an opportunity without a contact.
- LeadSquared says nothing about its currency: set it under Settings → Mapping → Amounts and currency.
How changes reach CoSell
Every few minutes CoSell reads the opportunities changed since its last look. To hear about a change at once, add two webhooks under My Profile → Settings → API and Webhooks → Webhooks:
- Event Opportunity Create, and a second webhook with the event Opportunity Update.
- Webhook URL: the one CoSell shows for LeadSquared. Content Type:
application/json. - Custom Headers: name
x-cosell-token, value the webhook token CoSell showed when you connected.
An automation's webhook action on an opportunity trigger works the same way. LeadSquared adds its own parameters to the address, so carry the token in the header rather than in the address.
Limits
LeadSquared allows 10 API calls every 5 seconds on the Pro plan and 20 on the Super plan, and 10,000 or 100,000 a day plus 1,000 per user. Sending one opportunity to AWS takes about eight calls. When LeadSquared answers that the limit is reached, CoSell tries again later; nothing is lost. LeadSquared has no search for opportunities by a field, so looking one up by its AWS opportunity ID reads your newest 10,000 opportunities at most.
CoSell calls only what LeadSquared's API documentation describes, but the connector has not yet run against a live LeadSquared account. The first connection is walked through with HabileLabs support, who confirm the answers that documentation leaves open: what LeadSquared answers for a deleted opportunity, reading an account by its ID, and how a multi-select dropdown's values are separated.