LeadSquared Developer Centre

ON THIS PAGE

Get Opportunities in a List


This API returns the opportunities that belong to a specific Opportunity List. Pass the list’s ID to retrieve its opportunities:

  • For a Static List, the API returns the opportunities manually added to it.
  • For a Dynamic List, the API returns the opportunities that currently match the list’s saved conditions.

The list you specify determines which opportunities are returned. You cannot pass separate search conditions to this API, but you can narrow results within the list using the optional quick search parameter.

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
{
    "ListId": "ccbba9d8-90e1-468d-90bc-bc5e4a6248d9",
    "OpportunityEventCode": "12543",
    "QuickSearch": "Jane",
    "Sorting": {
        "ColumnName": "CreatedOn",
        "Direction": 0
    },
    "Columns": {
        "Include_CSV": "mx_Custom_1,Status,Owner,CreatedOn"
    },
    "Paging": {
        "PageIndex": 1,
        "PageSize": 100
    }
}

Request Parameters

Parameter Description
ListId

The opportunity list ID. To find this value, navigate to the Opportunity List Details page, you’ll find the ID in your browser URL.

This field is required.

OpportunityEventCode

Opportunity type/event code. To find the code, navigate to Settings>Opportunities>Opportunity Types.

QuickSearch

Narrow results within the list using free-text search.

Sorting

Control the order in which opportunities are returned.

Columns

Choose which opportunity fields are returned.

Paging

Control how many results are returned per page.

Response

200 OK
Content-Type: application/json
{
    "Data": {
        "RecordCount": 1,
        "List": [
            {
                "mx_Custom_1": "Jane - Auto Loan",
                "Status": "Open",
                "Owner": "d5d08e32-5ca9-11ea-8dd7-029e1407a868",
                "CreatedOn": "4/6/2023 9:53:34 AM"
            }
        ]
    },
    "NextCursor": null
}

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.