LeadSquared Developer Centre

ON THIS PAGE

Get Opportunities by Unique Lead Field


Use this API to fetch opportunity records using a unique field on the lead (e.g., EmailAddress, Phone, etc.).

API URL

URL
Icon
POST https://{host}/v2/OpportunityManagement.svc/GetOpportunitiesByUniqueLeadField?accessKey=AccessKey&secretKey=SecretKey

Request

Content-Type: application/json
JSON Body/Payload Icon
{
    "Parameter": {
        "LookupName": "Mobile",
        "LookupValue": "+91-8271229832",
        "SqlOperator": "="
    },
    "Columns": {
        "Include_CSV": "ProspectId,FirstName"
    },
    "Sorting": {
        "ColumnName": "CreatedOn",
        "Direction": "1"
    },
    "Paging": {
        "PageIndex": 1,
        "PageSize": 25
    }
}

Request Parameters

Parameter Description
LookupName

Pass the SchemaName of the unique field.

LookupValue

Here you can pass the value of the unique field you want to retrieve.

For example, you can pass an email address or phone number of the lead.

SqlOperator

Pass the Equals To (“=”) operator.

Include_CSV

Pass the names of the columns you want to retrieve for the leads here, along with the columns, system fields will also be retrieved.

If you don’t pass any values, then all the custom fields will be retrieved along with system fields.

ColumnName

The name of the column you want to sort the results by.

Direction

Passing “1” will sort the data most recent first while “0” will sort oldest first.

PageIndex

Refers to the page number (“1” represents the first page).

PageSize

Refers to the number of records to be displayed.

Response

200 OK
Content-Type: application/json
{
    "RecordCount": 1,
    "List": [
        {
            "ProspectId": "fad0071e-9736-41ea-9877-75",
            "FirstName": "Sam",
            "RelatedProspectId": "fad0071e-9736-41ea-9877-752",
            "OpportunityEvent": "12000",
            "OpportunityEventType": "2",
            "TrackingNormalized": null,
            "ProspectActivityAutoId": null,
            "OpportunityNote": "test",
            "Score": null,
            "CreatedOn": "7/16/2024 10:12:24 AM",
            "ModifiedOn": "7/16/2024 10:12:26 AM",
            "CreatedBy": "d5d08e32-5ca9-11ea-8dd7-029e",
            "ProspectActivityExtensionId": null,
            "RelatedProspectActivityId": null,
            "Extension_CreatedOn": null,
            "Extension_CreatedBy": null,
            "StatusReason": null,
            "Extension_ModifiedOn": null,
            "Extension_ModifiedBy": null,
            "IP_Latitude": null,
            "IP_Longitude": null,
            "Propensity": null,
            "PropensityScore": null,
            "PreviousPropensityScore": null,
            "KeyPropensityInsights": null,
            "PropensityScoreCreatedOn": null,
            "RecommendedActionCode": null,
            "PropensityScoreModifiedOn": null,
            "PreviousPropensityScoreModifiedOn": null,
            "OpportunityAge": 367,
            "P_ProspectID": "fad0071e-9736-41ea-9877-752e2a74af18",
            "P_FirstName": "Sam",
            "P_LastName": "Wise",
            "P_EmailAddress": "Sam@lsqq.in",
            "P_OwnerIdName": "Srisudhan",
            "P_Phone": "+91-8271229832",
            "P_DoNotCall": "0",
            "P_DoNotEmail": "0",
            "P_CreatedOn": "7/15/2024 11:48:56 AM",
            "LastName": "Wise",
            "EmailAddress": "Sam@lsqq.in",
            "OwnerIdName": "Srisudhan",
            "Phone": "+91-8271229832",
            "DoNotCall": "0",
            "DoNotEmail": "0",
            "LeadName": "Sam Wise",
            "PACreatedByName": "Srisudhan",
            "PACreatedByEmail": "sri.sudhan@lsq.in",
            "PCreatedByEmail": "",
            "PModifiedByEmail": "",
            "POwnerEmail": "",
            "PAOwnerEmail": "",
            "ModifiedByEmail": "",
            "CreatedByName": "Srisudhan",
            "CreatedByEmail": "sri.sudhan@lsq.in",
            "LastRelatedActivityCreatedByEmail": "",
            "PACreatedOn": "7/16/2024 10:12:24 AM",
            "PAModifiedOn": "7/16/2024 10:12:26 AM",
            "OpportunityId": "2ab5a616-9b15-476b-953b"
        }
    ]
}

HTTP Response Codes

Code Description
200 OK

This is the status code for successful API call.

401 Unauthorized

The API call was made with invalid access credentials. Check your AccessKey and SecretKey.

400 Bad Request

The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure.

404 Not Found

The API could not be found. Please check the API signature.

429 Too Many Requests

API calls exceeded the limit of 25 in 5 second(s)

500 Internal Server Error

The API called failed. There could be many reasons for it. Check the exception message to get more details.

On this page

© 2024 by MarketXpander Services Pvt Ltd. All Rights Reserved.