Repository navigation
Activity Management
$leadsquared->get_activity_types();
This function will give you the list of Activity Types configured in LeadSquared.
It will return an array of Activity Types configured in your account.
Example { "ID": "b2b891b4-4d0e-11e2-9e64-12314004ac6b", "ActivityEventName": "Email - Positive Response", "DisplayName": "Positive Response to Email", "ActivityEvent": 12, "Score": 50, "EventType": 0 }
If EventType = 1, then it is a custom activity. ActivityEvent is what that gives you the type of activity, which you will need to use while posting the activity.
$leadsquared->post_activity($json_data);
This function only permits a Custom Notable Activity to be added to a Lead.
By providing Id of lead that you need to post activity on
$json_data = { "RelatedProspectId": "00727844-51aa-11e2-9e64-12314004ac6b", "ActivityEvent": 102, "ActivityNote": "Your Activity Note", "ActivityDateTime": "yyyy-mm-dd hh:mm:ss" }
"RelatedProspectId" is the ID of the lead that you need to post activity on.
"ActivityEvent" this is an Activity code which you can find in your leadsquared account here https://run.leadsquared.com/Settings/CustomNotableActivity or you can use $leadsquared->get_activity_types();
"ActivityDateTime" is the timestamp of when the activity happened.
"ActivityNote" is the note that is recorded while adding the activity by a user
Using this option you post activity using email address, this option can also be used create lead and post activity at a same time
$json_data = '{ "EmailAddress": "john.smith@acmeconsulting.co", "ActivityEvent": 112, "ActivityNote": "Note for the activity", "ActivityDateTime": "yyyy-mm-dd hh:mm:ss", "FirstName": "John", "LastName" : "Smith", "Phone" : "+919845098450", "Score": 10 }'
Note:- Not all lead schema are supported, when using this function to create lead and post activity. Supported Scheme name are FirstName,LastName,Phone,Score,Website& note
$leadsquared->create_activity_type($json_data);
Using this function you can create a new activity type in your leadsquared account
$json_date = '{ "ActivityEventName": "", "Score": 10, "Description": "", "Direction": 1 }';
"ActivityEventName":- This is the name of the activity you want to name it. "Score":- tYou can assign custom lead score for your activity in Score field. "Description":- Description of the activity type. "Direction":- Direction is 1 for Outbound Activity and 0 for Inbound Activity.
$leadsquared->get_activities_of_lead($leadId , $json_data = null);
Using this function you can get the activities of lead by providing lead id in json format .
"json_data" is optional in the function. This is use to refine the result
$json_data='{ "Parameter": {"ActivityEvent": } "Paging": {"Offset": "","RowCount": ""} }';
This function will return an array of Activities with all details. Since different Activity types have different data structures, the data that is not common between activities is encapsulated in “Data” which is a name value pair of all properties for that activity.
Example
{ "Id": "", "EventCode": , "EventName": "Email Opened", "ActivityScore": , "CreatedOn": "<time>", "IsEmailType": true, "EmailType": "Email Campaign", "Data": [ { "Key": "EmailCampaignName", "Value": "" }, { "Key": "Subject", "Value": "</time>" } }