LeadSquared Developer Centre

ON THIS PAGE

Get Opportunities in Bulk by Ids


Retrieves multiple opportunities.

  • The ProspectActivityId parameter is mandatory. Pass multiple Opportunity IDs here. You can find the Opportunity ID in the URL of the relevant Opportunity Details page.
  • The EventCode parameter is mandatory. You can find the Event Code of the opportunity on the URL of the relevant Opportunity Details page.
  • The Include_CSV parameter is also mandatory. Pass the columns you want to retrieve here.

Note: You can retrieve a maximum of 2,000 opportunities.

API URL

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

Request

Content-Type: application/json
JSON Body/Payload Icon
{
   "SearchParameters":[
      {
         "EventCode":"12003",
         "ProspectActivityId":[
            "24cf277e-70fe-4b2f-a9c2-9a68f45feaba",
            "67db1ccf-ea8b-41b8-9bc2-4cdbe2391a0d"
         ],
         "Columns":{
            "Include_CSV":"CreatedOn,ModifiedOn,Owner"
         }
      },
      {
         "EventCode":"12001",
         "ProspectActivityId":[
            "2232837f-0f5e-4607-8e50-2728d90b9b5c"
         ],
         "Columns":{
            "Include_CSV":"CreatedOn,ModifiedOn,Owner"
         }
      }
   ]
}

Request Parameters

Parameter Description
ProspectActivityId

Pass the Opportunity IDs you want to retrieve here.

Include_CSV

Pass the names of the columns you want to retrieve for the Opportunities here.

EventCode

The opportunity event code. This is a mandatory field.

Response

200 OK
Content-Type: application/json
[
    {
        "EventCode": "12003",
        "RecordCount": 3,
        "Opportunities": [
            {
                "ProspectId": "a368678f-1e81-4fb8-af0a-4b896f6330e1",
                "EmailAddress": "janehewitt@example.com",
                "ProspectActivityId": "24cf277e-70fe-4b2f-a9c2-9a68f45feaba",
                "CreatedOn": "4/6/2023 3:23:34 PM",
                "ModifiedOn": "4/6/2023 3:23:34 PM",
                "Owner": "d5d08e32-5ca9-11ea-8dd7-029e1407a868",
                "OwnerEmailAddress": "sri.sudhan@mcn.christuniversity.in"
            },
            {
                "ProspectId": "332c7a9f-6451-11ea-8109-022edb41208c",
                "EmailAddress": "george.costanza@example.com",
                "ProspectActivityId": "67db1ccf-ea8b-41b8-9bc2-4cdbe2391a0d",
                "CreatedOn": "11/24/2021 1:17:20 PM",
                "ModifiedOn": "5/4/2022 7:26:35 PM",
                "Owner": "d5d08e32-5ca9-11ea-8dd7-029e1407a868",
                "OwnerEmailAddress": "sri.sudhan@mcn.christuniversity.in"
            },
            {
                "ProspectId": "9a13bba8-c85c-4b22-acb7-a347dba60268",
                "EmailAddress": "jerry.seinfeld@example.com",
                "ProspectActivityId": "2232837f-0f5e-4607-8e50-2728d90b9b5c",
                "CreatedOn": "3/11/2021 2:37:51 PM",
                "ModifiedOn": "5/14/2021 4:44:46 PM",
                "Owner": "d5d08e32-5ca9-11ea-8dd7-029e1407a868",
                "OwnerEmailAddress": "sri.sudhan@mcn.christuniversity.in"
            }
        ]
    },
    {
        "EventCode": "12001",
        "RecordCount": 0,
        "Opportunities": []
    }
]

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

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