Opportunity Advanced Search
Lets you retrieve Opportunities using the advanced search criteria.
- This API is only accessible to Administrator users.
OpportunityEvent
andAdvancedSearch
are mandatory fields.- The
AdvancedSearch
criteria can be captured using theOpportunityGrid
network call.- Navigate to Leads>Manage Opportunities>Opportunity Type.
- From the Opportunity Grid, open your browser’s developer tools.
- Navigate to the Network tab, and search for ActivityGrid.
- From Form Data, copy the
AdvancedSearch
parameter value. - You may have to use escape characters in the JSON (replace ” with \”). After you add it, then pass it in the
AdvancedSearch
parameter in the JSON payload.
Notes:
- For ESS customers, custom field sets are represented as
mx_Custom_3~mx_CustomObject_1
. Note that the “~” symbol may be shown in hexadecimal form as x007E. Please get in touch with your account manager to know whether your account has ESS enabled. - The time zone considered is Universal Time Coordinated (UTC). You may need to convert the time from your local time zone to UTC before passing it here.
API URL
Request
Content-Type: application/json{ "OpportunityEventCode":12005, "AdvancedSearch":"{\"GrpConOp\":\"And\",\"Conditions\":[{\"Type\":\"Activity\",\"ConOp\":\"and\",\"RowCondition\":[{\"SubConOp\":\"And\",\"LSO\":\"ActivityEvent\",\"LSO_Type\":\"PAEvent\",\"Operator\":\"eq\",\"RSO\":\"12005\"}]}],\"QueryTimeZone\":\"India Standard Time\"}", "Paging":{ "PageIndex":1, "PageSize":10 }, "Sorting":{ "ColumnName":"CreatedOn", "Direction":1 } }
Request Parameters
Parameter | Description |
---|---|
OpportunityEventCode | The code for the opportunity type. To find it, navigate to My Profile>Settings>Opportunities>Opportunity Type. It is listed under the column Code. This is a mandatory field. |
AdvancedSearch | The advanced search criteria can be captured using the Activity Grid network call. See the process above for details. This is a mandatory field. |
Paging |
Note: Default page size is 25. Maximum page size is 1,000. |
Sorting |
Note: Default sorting is on activity |
Response
{ "RecordCount":3, "List":[ { "OpportunityEventType":"2", "OpportunityEvent":"12005", "CreatedOn":"2020-11-05 10:28:26", "ModifiedOn":"2020-12-10 10:10:28", "mx_Custom_1":"Rahul Sen - Loan", "Status":"Open", "mx_Custom_2":"Need Analysis", "mx_Custom_6":"312500", "mx_Custom_8":"2020-12-24 10:10:00", "Owner":"a4dfa1c5-c6d2-11ea-92ae-0a6d35d1ff1e", "RelatedProspectId":"83543043-91d1-4ca1-926b-aad0bab94f7e", "OpportunityId":"c005f516-f2ca-41dd-a1cf-0993a22fbd3b" }, { "OpportunityEventType":"2", "OpportunityEvent":"12005", "CreatedOn":"2020-11-05 10:25:20", "ModifiedOn":"2020-12-10 10:10:08", "mx_Custom_1":"Arjun Shetty - Loan", "Status":"Lost", "mx_Custom_2":"Decided not to buy", "mx_Custom_6":"145000", "mx_Custom_8":"2020-11-11 10:09:00", "Owner":"a4dfa1c5-c6d2-11ea-92ae-0a6d35d1ff1e", "RelatedProspectId":"83543043-91d1-4ca1-926b-aad0bab94f7e", "OpportunityId":"7dfcdae7-f2c3-4a8b-8f85-bbe603ed7bb7" }, { "OpportunityEventType":"2", "OpportunityEvent":"12005", "CreatedOn":"2020-09-16 05:44:47", "ModifiedOn":"2020-10-16 06:10:54", "mx_Custom_1":"Manish Garg - Loan", "Status":"Won", "mx_Custom_2":"Closed - Won", "mx_Custom_6":"2500000", "mx_Custom_8":"2020-11-06 05:45:00", "Owner":"a4dfa1c5-c6d2-11ea-92ae-0a6d35d1ff1e", "RelatedProspectId":"69e1c27e-dd08-4b53-b509-f353ad1c7f4d", "OpportunityId":"4597c076-be5a-4ba2-9b08-ecd21626750f" } ] }
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. |