Leads Not Contacted
This API retrieves leads on which specified activities have not been posted. The API structure consists of report filters (consisting of user, lead and activity filters), date filters, output conditions, and response format. By using a combination of these parameters, you can get analytical insights on varied use cases.
Example Use Cases
- Leads in a particular stage (prospect, opportunity, etc.) who have not been contacted in the last month.
- Leads filtered by any lead field (source, city, account, etc.) on who specified activities have not taken place (document collection, meeting, field visit, loan application, etc.) within a certain time frame.
Structure of the API
- The “Report Filter” node contains “UserFilter”, “LeadFilters” and “Activity Filters” parameters.
- The “UserFilter” lets you use condition groups (see User Advanced Search) to filter users.
- The “LeadFilters” lets you filter based on any lead field.
- The “ActivityFilters” let you specify one or more system, sales or custom activities that have not been posted on leads. If no activity filter is specified, all activities will be returned.
- The “DateFilter” node lets you filter based on a particular date field (modified on, created on, etc.) and range.
- The “Output” node lets you control how you want the results to be displayed.
- You can retrieve results as a ‘list’ of leads
- Or you can use the ‘aggregate’ option to perform operations like averaging or summing up a particular lead field (lead score, engagement score, etc.). This option is more valid for the Lead Distribution Analytics API.
- “Paging” options are used the same way across all our APIs. Use them to sort your results.
Note: The “ResponseFormat” parameter in the API URL lets you retrieve results in either JSON (default) or CSV formats.
API URL
URL Parameters
Parameter | Description |
---|---|
ResponseFormat | The response can be displayed in either JSON (default) or CSV formats. The response Content-Type will be “text/csv” in case of CSV response format. The CSV attachment can be downloaded. |
Request
Content-Type: application/json{ "ReportFilter": { "UserFilter": { "GroupConditions": [ { "Condition": [ { "LookupName": "UserID", "Operator": "eq", "LookupValue": "8e7da340-740a-11e5-8de3-22000aa5088d,ca00fef0-73f7-11e5-8de3-22000aa5088d,dd908e91-c5c9-11e5-8de3-22000aa5088d" } ] } ] }, "LeadFilters": [ { "LookUpName": "ProspectStage", "LookUpValues": [ "Prospect", "Opportunity" ], "SqlOperator": "in" } ], "ActivityFilters": [ { "LookUpName": "ActivityEvent", "LookUpValues": [ "21", "22" ], "SqlOperator": "in" } ] }, "DateFilter": [ { "DateField": "LeadCreatedOn", "FromDate": "2018-05-10 12:10:00", "ToDate": "2018-11-10 12:00:00" } ], "Output": { "Type": "List|Aggregate", "GroupBy": "OwnerId", "AggregateFunction": "Count|Average|Sum", "AggregateField": "EngagementScore", "IncludeCSV": "ProspectID,ProspectStage,ProspectActivityDate_Max,OwnerId" }, "Paging": { "PageIndex": 1, "PageSize": 10 } }
Request Parameters
Parameter | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
User Filter | You can enter multiple User Ids/Email Addresses or use advanced search conditions. If no user filter is specified, all users will be considered. |
||||||||||||||||||||||
Lead Filters | You can enter multiple lead field filters separated by AND condition.
|
||||||||||||||||||||||
Activity Filters | You can enter multiple activity field filters separated by AND condition.
Note: For an exact match pass “SqlOperator”:”=” |
||||||||||||||||||||||
Date Filter | Lets you leads based on a particular date field. Multiple date filters are permitted.
Note: The date format must be yyyy-MM-dd hh:mm:ss |
||||||||||||||||||||||
Output | “Type” – You can receive the output as either
|
||||||||||||||||||||||
Paging | The results matching your criteria may be large. You can fetch the result in blocks of “PageSize” and make multiple calls to the API with increasing values of “PageIndex”. For example, you can specify “PageIndex”: 1, “PageSize”: 100 for the first call and specify “PageIndex”: 2, “PageSize”: 100 for second call. |
Response
{ "TotalCount": "211507", "Results": [ { "OwnerId": "a1af592d-d173-11e6-b172-023cca4497b9", "ProspectActivityDate_Max": null, "ProspectStage": "Opportunity", "ProspectID": "962db064-3031-4428-9ce6-5e1a23180d63" }, { "OwnerId": "244af296-4cbe-11e5-b982-22000aa68b6f", "ProspectActivityDate_Max": null, "ProspectStage": "Opportunity", "ProspectID": "7844f330-b976-479d-8573-74070f63e9bf" }, { "OwnerId": "c7b539c1-3f7f-11e6-bec9-22000aa5088d", "ProspectActivityDate_Max": "2019-08-08 18:30:30", "ProspectStage": "Opportunity", "ProspectID": "fc68c495-8e29-4db8-80d8-5c296b0ff2f1" }, { "OwnerId": "c7b539c1-3f7f-11e6-bec9-22000aa5088d", "ProspectActivityDate_Max": "2019-01-16 04:58:26", "ProspectStage": "Prospect", "ProspectID": "d6b8b6bc-5a96-11e8-ab2b-02742c1c8abe" }, { "OwnerId": "c7b539c1-3f7f-11e6-bec9-22000aa5088d", "ProspectActivityDate_Max": "2019-01-16 04:58:26", "ProspectStage": "Prospect", "ProspectID": "d6b8b92d-5a96-11e8-ab2b-02742c1c8abe" } ] }
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. |