LeadSquared Developer Centre

ON THIS PAGE

Get Opportunity Lists


This API returns the Opportunity Lists available in your account. Use it to build a list picker, display member counts, or check which lists exist for a given Opportunity Type.

You can filter the results by list type (Static or Dynamic) or by searching for a list name, and sort the results by fields like name, member count, or creation date.

Note: All request fields are optional, but you must send a request body – An empty JSON object ({}).

API URL

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

Request

Content-Type: application/json
JSON Body/Payload Icon
{
    "ListType": 0,
    "SearchText": "Chennai",
    "SortColumn": "MemberCount",
    "SortOrder": 1,
    "Columns": "ListId,Name,MemberCount,ListType,CreatedOn",
    "Paging": {
        "PageIndex": 1,
        "PageSize": 50
    }
}

Request Parameters

Parameter Description
ListType

Filter by list type:

  • 0 = Static List
  • 1 = Dynamic List

Omit to return all.

SearchText

Find lists whose name contains a specific keyword (case-sensitive).

SortColumn

Control how the fields are sorted.

Allowed:

  • Name
  • MemberCount
  • ListType
  • CreatedOn
  • ModifiedOn

The default value is CreatedOn.

SortOrder

Control how the results are sorted.

  • 0 = ascending
  • 1 = descending

The default value is 0.

Columns

Choose which list details are returned. Default columns (if Columns is omitted): ListId, Name, MemberCount, ListType, CreatedOn, CreatedBy.

Paging

Control how many results are returned per page. Max page size is 1000.

Response

200 OK
Content-Type: application/json
{
    "Lists": [
        {
            "ListId": "ccbba9d8-90e1-468d-90bc-bc5e4a6248d9",
            "Name": "Chennai Opportunities",
            "MemberCount": 8,
            "ListType": 0,
            "CreatedOn": "/Date(1786434435000+0000)/"
        }
    ],
    "TotalCount": 1
}

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.