LeadSquared Developer Centre

ON THIS PAGE

Get Activities by Lead Reference


Lets you retrieve all the activities where a lead is referenced through a custom field set.

  • You must pass the leadId in the query string.
  • You may optionally pass the ActivityEvent to retrieve only a particular activity type where the lead is referenced.

Note: The API returns results based on the user’s access key and secret key. Since certain user roles may not have permission to view all leads, we recommend you pass the API keys of an admin user to get all results.

 

API URL

URL
Icon
POST https://{host}/v2/ProspectActivity.svc/GetLeadReferences?accessKey=AccessKey&secretKey=SecretKey&leadId=LeadId

URL Parameters

Parameter Description
LeadId The unique identifier of the lead.

Request

Content-Type: application/json
JSON Body/Payload Icon
{ 
   "Parameter":{ 
      "ActivityEvent":174
   },
   "Paging":{ 
      "PageIndex":1,
      "PageSize":50
   },
   "Sorting":{ 
      "ColumnName":"ModifiedOn",
      "Direction":0
   }
}

Request Parameters

Parameter Description
Parameter

You may pass the ActivityEvent here.

This parameter is optional. If not passed, all activities where the lead is referenced will be returned

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: The maximum page size allowed is 50

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.

Response

200 OK
Content-Type: application/json
{
    "RecordCount": 1,
    "ProspectActivities": [
        {
            "ID": "84447a80-1f91-46b7-9562-92e66a1ec0e1",
            "Name": "CFS Demo",
            "DisplayName": "CFS Lead Type Demo",
            "Fields": [
                {
                    "SchemaName": "ActivityEvent_Note",
                    "InternalName": "ActivityEvent_Note",
                    "DisplayName": "Notes",
                    "Value": null,
                    "DataType": "String",
                    "IsMandatory": false,
                    "ShowInForm": true,
                    "Sequence": 0,
                    "ParentField": "",
                    "OptionSet": "",
                    "DependentOptionSet": "",
                    "IsDefault": true,
                    "IsReadOnly": false,
                    "RenderType": "",
                    "ExportAsPlainText": false,
                    "IsMultiSelectDropdown": false,
                    "IncludeOthersOption": false,
                    "BehaviorOnMissingDropdownOption": 0,
                    "IsOthersValue": false,
                    "InternalSchemaName": ""
                },
                {
                    "SchemaName": "Status",
                    "InternalName": "Status",
                    "DisplayName": "Status",
                    "Value": "",
                    "DataType": "SearchableDropdown",
                    "IsMandatory": false,
                    "ShowInForm": true,
                    "Sequence": 1,
                    "ParentField": "",
                    "OptionSet": "[{\"IsDefault\":true,\"Text\":\"\",\"Value\":\"Active\",\"Order\":0,\"CanEdit\":1,\"CanDelete\":1,\"IsLastOption\":0},{\"IsDefault\":false,\"Text\":\"\",\"Value\":\"Inactive\",\"Order\":1,\"CanEdit\":1,\"CanDelete\":1,\"IsLastOption\":0}]",
                    "DependentOptionSet": "",
                    "IsDefault": true,
                    "IsReadOnly": false,
                    "RenderType": "",
                    "ExportAsPlainText": false,
                    "IsMultiSelectDropdown": false,
                    "IncludeOthersOption": false,
                    "BehaviorOnMissingDropdownOption": 0,
                    "IsOthersValue": false,
                    "InternalSchemaName": ""
                },
                {
                    "SchemaName": "Owner",
                    "InternalName": "Owner",
                    "DisplayName": "Owner",
                    "Value": "",
                    "DataType": "ActiveUsers",
                    "IsMandatory": false,
                    "ShowInForm": true,
                    "Sequence": 1,
                    "ParentField": "",
                    "OptionSet": "",
                    "DependentOptionSet": "",
                    "IsDefault": true,
                    "IsReadOnly": false,
                    "RenderType": "",
                    "ExportAsPlainText": false,
                    "IsMultiSelectDropdown": false,
                    "IncludeOthersOption": false,
                    "BehaviorOnMissingDropdownOption": 0,
                    "IsOthersValue": false,
                    "InternalSchemaName": "Owner"
                },
                {
                    "SchemaName": "mx_Custom_1",
                    "InternalName": "mx_Custom_1",
                    "DisplayName": "Loan Details",
                    "Value": "{\"mx_CustomObject_1\":\"3a6d5ea2-400e-4a2f-a728-fbfa0b0c1ddf\",\"mx_CustomObject_3\":\"8ccd911f-8a27-496c-9ff1-696733a4d77a\"}",
                    "DataType": "CustomObject",
                    "IsMandatory": false,
                    "ShowInForm": true,
                    "Sequence": 1,
                    "ParentField": "",
                    "OptionSet": "",
                    "DependentOptionSet": "",
                    "IsDefault": false,
                    "CustomObjectFormProperties": {
                        "FieldProperties": {
                            "CustomObjectId": "f9c266d6-e381-11e9-aebf-02b00a4d022c",
                            "FormMetaData": [
                                {
                                    "CustomObjectFormProperties": null,
                                    "DataType": "SearchableDropdown",
                                    "DependentOptionSet": null,
                                    "DependentOptionsCSV": null,
                                    "DisplayName": "Status",
                                    "FileContentProperties": null,
                                    "FileStorageVersion": 0,
                                    "FileURL": null,
                                    "InternalName": null,
                                    "IsDefault": false,
                                    "IsDerived": false,
                                    "IsMandatory": false,
                                    "IsReadOnly": false,
                                    "LeadFieldDetails": null,
                                    "LeadFieldProperties": null,
                                    "OptionSet": "[{\"IsDefault\":true,\"Text\":\"\",\"Value\":\"Pending\",\"Order\":0,\"CanEdit\":1,\"CanDelete\":1,\"IsLastOption\":0},{\"IsDefault\":false,\"Text\":\"\",\"Value\":\"Approved\",\"Order\":2,\"CanEdit\":1,\"CanDelete\":1,\"IsLastOption\":0}]",
                                    "OptionsCSV": null,
                                    "ParentField": null,
                                    "SchemaName": "Status",
                                    "Sequence": 1,
                                    "ShowInForm": true,
                                    "Value": "Pending"
                                },
                                {
                                    "CustomObjectFormProperties": null,
                                    "DataType": "Lead",
                                    "DependentOptionSet": null,
                                    "DependentOptionsCSV": null,
                                    "DisplayName": "Borrower",
                                    "FileContentProperties": null,
                                    "FileStorageVersion": 0,
                                    "FileURL": null,
                                    "InternalName": null,
                                    "IsDefault": false,
                                    "IsDerived": false,
                                    "IsMandatory": false,
                                    "IsReadOnly": false,
                                    "LeadFieldDetails": {
                                        "EmailAddress": "m@gm.com",
                                        "FirstName": "Lennox",
                                        "LastName": "Lewis"
                                    },
                                    "LeadFieldProperties": {
                                        "AllowAllLeadAccess": false
                                    },
                                    "OptionSet": null,
                                    "OptionsCSV": null,
                                    "ParentField": null,
                                    "SchemaName": "mx_CustomObject_1",
                                    "Sequence": 0,
                                    "ShowInForm": true,
                                    "Value": "3a6d5ea2-400e-4a2f-a728-fbfa0b0c1ddf"
                                },
                                {
                                    "CustomObjectFormProperties": null,
                                    "DataType": "Lead",
                                    "DependentOptionSet": null,
                                    "DependentOptionsCSV": null,
                                    "DisplayName": "Co-Borrower",
                                    "FileContentProperties": null,
                                    "FileStorageVersion": 0,
                                    "FileURL": null,
                                    "InternalName": null,
                                    "IsDefault": false,
                                    "IsDerived": false,
                                    "IsMandatory": false,
                                    "IsReadOnly": false,
                                    "LeadFieldDetails": null,
                                    "LeadFieldProperties": {
                                        "AllowAllLeadAccess": true
                                    },
                                    "OptionSet": null,
                                    "OptionsCSV": null,
                                    "ParentField": null,
                                    "SchemaName": "mx_CustomObject_2",
                                    "Sequence": 0,
                                    "ShowInForm": true,
                                    "Value": null
                                },
                                {
                                    "CustomObjectFormProperties": null,
                                    "DataType": "Lead",
                                    "DependentOptionSet": null,
                                    "DependentOptionsCSV": null,
                                    "DisplayName": "Referred By",
                                    "FileContentProperties": null,
                                    "FileStorageVersion": 0,
                                    "FileURL": null,
                                    "InternalName": null,
                                    "IsDefault": false,
                                    "IsDerived": false,
                                    "IsMandatory": false,
                                    "IsReadOnly": false,
                                    "LeadFieldDetails": null,
                                    "LeadFieldProperties": {
                                        "AllowAllLeadAccess": true
                                    },
                                    "OptionSet": null,
                                    "OptionsCSV": null,
                                    "ParentField": null,
                                    "SchemaName": "mx_CustomObject_3",
                                    "Sequence": 0,
                                    "ShowInForm": true,
                                    "Value": "8ccd911f-8a27-496c-9ff1-696733a4d77a"
                                }
                            ]
                        },
                        "FormLayout": {
                            "AvailableFields": [],
                            "Sections": [
                                {
                                    "DisplayName": "Custom Field Set Details",
                                    "Fields": [
                                        {
                                            "Colspan": 1,
                                            "SchemaName": "Status"
                                        },
                                        {
                                            "Colspan": 1,
                                            "SchemaName": "mx_CustomObject_1"
                                        },
                                        {
                                            "Colspan": 1,
                                            "SchemaName": "mx_CustomObject_2"
                                        },
                                        {
                                            "Colspan": 1,
                                            "SchemaName": "mx_CustomObject_3"
                                        }
                                    ]
                                }
                            ]
                        },
                        "DisplayName": "Loan Details",
                        "CreatedOn": "2019-09-30 13:07:37",
                        "CreatedByName": "Peter Griffin",
                        "ModifiedByName": "Peter Griffin",
                        "FileStorageVersion": -1
                    },
                    "IsReadOnly": false,
                    "RenderType": "",
                    "ExportAsPlainText": false,
                    "IsMultiSelectDropdown": false,
                    "IncludeOthersOption": false,
                    "BehaviorOnMissingDropdownOption": 0,
                    "IsOthersValue": false,
                    "InternalSchemaName": ""
                }
            ],
            "CreatedByName": "Peter Griffin",
            "CreatedOn": "/Date(1569848580000+0000)/",
            "RelatedProspectId": "3a6d5ea2-400e-4a2f-a728-fbfa0b0c1ddf",
            "ActivityEvent_Note": "",
            "IsEditable": 1,
            "ActivityEvent": 174,
            "CreatedOnString": "2019-09-30 13:03:00",
            "ActivityEventType": "2",
            "FormLayout": {
                "AvailableFields": [
                    {
                        "Colspan": 1,
                        "SchemaName": "Status"
                    },
                    {
                        "Colspan": 1,
                        "SchemaName": "Owner"
                    }
                ],
                "Sections": [
                    {
                        "DisplayName": "Activity Details",
                        "Fields": [
                            {
                                "Colspan": 1,
                                "SchemaName": "ActivityEventName"
                            },
                            {
                                "Colspan": 1,
                                "SchemaName": "CreatedOn"
                            },
                            {
                                "Colspan": 1,
                                "SchemaName": "AssociatedEntityIdName"
                            },
                            {
                                "Colspan": 2,
                                "SchemaName": "ActivityEvent_Note"
                            },
                            {
                                "Colspan": 2,
                                "SchemaName": "mx_Custom_1"
                            }
                        ]
                    }
                ]
            },
            "AuditActivity": true,
            "AllowPreDatedActivity": true,
            "VCardFormLayout": {
                "AvailableFields": [],
                "Sections": [],
                "VCardColor": null
            },
            "ModifiedOn": "/Date(1569849077000+0000)/",
            "ModifiedBy": "bf8ce802-836f-11e7-8758-0a106ee76b21",
            "ModifiedByName": "Peter Griffin",
            "IsActive": true,
            "LockActivity": {
                "CanLock": false,
                "Roles": 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

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