LeadSquared Developer Centre

ON THIS PAGE

Activity Advanced Search


Lets you retrieve activities using advanced search criteria.

  • ActivityEvent and AdvancedSearch are mandatory fields.
  • The AdvancedSearch criteria can be captured using the ActivityGrid network call.
    1. Open your browser’s developer tools.
    2. Navigate to the Network tab.
    3. Search for ActivityGrid.
    4. Copy the AdvancedSearch parameter value from Form Data.
    5. You may have to use escape characters in the JSON (replace ” with \”), then pass it in the AdvancedSearch parameter in the JSON payload.

activity advanced search API

Note:

  • 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.
  • This API is only accessible to Administrator users.
  • 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

URL
Icon
POST https://{host}/v2/ProspectActivity.svc/Activity/Retrieve/BySearchParameter?accessKey=AccessKey&secretKey=SecretKey

Request

Content-Type: application/json
JSON Body/Payload Icon
{
  "ActivityEvent": 30,
  "AdvancedSearch": "{\"GrpConOp\":\"And\",\"Conditions\":[{\"Type\":\"Activity\",\"ConOp\":\"and\",\"RowCondition\":[{\"SubConOp\":\"And\",\"LSO\":\"ActivityEvent\",\"LSO_Type\":\"PAEvent\",\"Operator\":\"eq\",\"RSO\":\"30\"}]}],\"QueryTimeZone\":\"India Standard Time\"}",
  "Paging": {
    "PageIndex": 1,
    "PageSize": 10
  },
  "Sorting": {
    "ColumnName": "CreatedOn",
    "Direction": 1
  },
  "Columns": {
    "Include_CSV": "ProspectActivityId"
  }
}

Request Parameters

Parameter Description
ActivityEvent

The code for the activity event. Find it by navigating to My Account>Settings>Customizations>Activities and Scores>Cutom Activities & Scores

AdvancedSearch

The advanced search criteria can be captured using the Activity Grid network call. See the process above for details.

Paging

PageIndex and PageSize – 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”.

Note: Default page size is 25. Max page size is 1000.

Sorting

ColumnName – The column on which results will be sorted. For example, if you want results to be shown based on creation date, pass “CreatedOn”.

Direction – Direction “1” means descending order and “0” means ascending order.

Note: Default sorting is on activity ModifiedOn column as descending order

Columns

If Include_CSV is not specified, by default, these columns are fetched: ProspectActivityId, RelatedProspectId, ActivityEvent, ActivityType, CreatedOn, ModifiedOn

Note:

  • Activity custom fields such as mx_Custom_1 can be included.
  • Lead fields can also be included by P_ with the lead field name. For example,  P_EmailAddress

Response

200 OK
Content-Type: application/json
{
  "RecordCount": 220,
  "List": [
    {
      "ProspectActivityId": "d1d3eabb-0c44-4d55-8d85-a0b87dd6275a",
      "RelatedProspectId": "9142b58d-7855-11e8-a43f-02742c1c8abe",
      "ActivityEvent": "30",
      "ActivityType": "4",
      "CreatedOn": "2019-09-05 18:30:00",
      "ModifiedOn": "2019-10-28 15:16:44"
    }
  ]
}

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.