Post Activities on Leads in Bulk (Using Lead Id)

Lets you post multiple activities on a single lead or multiple activities on multiple leads in one API call. You can post up to 25 activities in a single call.

  • You need to specify the “LeadId” and “ActivityEvent”. 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.

 

API URL

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

Request

JSON Body/Payload

Content-Type: application/json

[  
   {  
      "RelatedProspectId":"2bf6a491-c144-4ac9-90f9-f52b6fc44413",
      "ActivityEvent":320,
      "ActivityNote":"Add/ByLeadId",
      "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"
         }
      ]
   },
   {  
      "RelatedProspectId":"c988e982-d01d-11e7-b4ec-069729b2474c",
      "ActivityEvent":320,
      "ActivityNote":"Add/ByLeadId",
      "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
RelatedProspectId

The Id of the lead on which the activity will be posted.

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.