Post Activities on Leads in Bulk Using (Unique Lead Fields)

Lets you post activities to leads in bulk.

  • Specify the lead you want to post an activity to by passing any unique lead field.*
    • Pass the field name in the “SearchBy” parameter in the API URL.
    • Pass the field value in the “SearchByValue” attribute in the JSON body.
  • Specify the activity you want to post to a lead by passing the “ActivityEvent”. You can find it under the ‘Code’ column here.
    • The “ActivityNote”, “ActivityOwnerEmail” and “Activity DateTime” parameters are optional.
    • You can also pass custom fields by specifying their “SchemaNames” and “Values” within the “Fields” node.

* Default unique lead fields include “EmailAddress”, “Phone” and “Mobile”. However, you can set your own unique lead fields according to your business requirements. This API accepts all unique lead fields, the defaults and also the ones you set.

 

API URL

POST
https://{host}/v2/ProspectActivity.svc/Bulk/CustomActivity/Add/ByLeadField?accessKey=AccessKey&secretKey=SecretKey&searchBy=SearchBy
Copy URL

URL Parameters

Parameter Description
SearchBy The name of the unique lead field. E.g., EmailAddress

Request

JSON Body/Payload

Content-Type: application/json

[
    {
        "SearchByValue": "user1@domain.com",
        "ActivityEvent": 320,
        "ActivityNote": "Add/ByEmailAddress",
        "ActivityOwnerEmail": "example@example.com",
        "Fields": [
            {
                "SchemaName": "mx_Custom_1",
                "Value": "First"
            },
            {
                "SchemaName": "mx_Custom_2",
                "Value": "0419"
            },
            {
                "SchemaName": "mx_Custom_3",
                "Value": "Activity Test"
            },
            {
                "SchemaName": "mx_Custom_4",
                "Value": "2016-09-18 12:12:12"
            }
        ]
    },
    {
        "SearchByValue": "user2@domain.com",
        "ActivityEvent": 320,
        "ActivityNote": "Add/EmailAddress",
        "ActivityOwnerEmail": "example2@example.com",
        "Fields": [
            {
                "SchemaName": "mx_Custom_1",
                "Value": "First"
            },
            {
                "SchemaName": "mx_Custom_2",
                "Value": "0419"
            },
            {
                "SchemaName": "mx_Custom_3",
                "Value": "Activity Test"
            },
            {
                "SchemaName": "mx_Custom_4",
                "Value": "2016-09-18 12:12:12"
            }
        ]
    }
]

JSON Properties

Parameter Description
SearchByValue

Value of the “SearchBy” attribute you passed in the API URL. For example, if you passed “EmailAddress” in the API URL, then pass “john@example.com” here.

ActivityEvent

The code of the activity. You can find activity codes in your LeadSquared account settings or by calling this API: Get List of Activity Types

ActivityNote

The description or notes associated with the activity.

ActivityOwnerEmail

Email Id of the LeadSquared user who is the owner of the activity.

Fields

You can optionally pass custom activity fields here by specifying their “SchemaNames” and “Values”. E.g. “SchemaName”: “mx_Custom_1”,
“Value”: “100”

Response

200 OK

Content-Type: application/json

{
    "Response": [
        {
            "ProspectActivityId": "6e2a3c76-9e57-4dd6-8bf1-660960336d6e",
            "RowNumber": 1,
            "ActivityCreated": true
        },
        {
            "ProspectActivityId": "50d619b7-9013-4467-aa6a-389d82530a69",
            "RowNumber": 2,
            "ActivityCreated": true
        }
    ]
}

HTTP Response Code

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.