LeadSquared Developer Centre

ON THIS PAGE

Post a Call Log


Lets you to post a call log for the LeadSquared Generic Telephony Connector. The call log gets posted as an activity to the corresponding lead.

Note:

  • You need to pass the “LeadId” and the corresponding “UserId” in the JSON body.
  • The API supports the formatting of phone numbers less than 10 digits in length based on the default country code. For e.g., if you pass a Singapore number (+6512345678), and if the default country code is set (+65), the API will only consider 12345678 as the actual number.

 

API URL

URL
Icon
POST https://{host}/v2/Telephony.svc/LogCall?accessKey=AccessKey&secretKey=SecretKey

Request

Content-Type: application/json
JSON Body/Payload Icon
{  
   "SourceNumber":"+91-8611795988",
   "CallerSource":"Example Source", 
   "DestinationNumber":"+91-9611795983",
   "DisplayNumber":"+91-8611795989",
   "StartTime":"2017-07-07 18:26:38",
   "EndTime":"2017-07-07 18:26:38",
   "CallDuration":34,
   "Status":"Answered",
   "ResourceURL":"google.com",
   "Direction":"Inbound",
   "CallSessionId":"12345",
   "LeadId":"e6d7efd4-ee4f-47a1-ab53-a3ff2902bfcb",
   "Tag":"Tag - Lead",
   "UserId":"40e06a3d-4787-11e7-b781-023cca4497b9"
}

Request Parameters

Parameter Description
SourceNumber

This is the source telephone number. In case of an inbound call, the source phone number is the lead’s phone number. In case of an outbound call, the source is the agent phone number.

CallerSource

This parameter allows you to pass the caller source. For example, if the caller came through a newspaper advertisement, enter “Newspaper Advertisement” here.
You can pass any string of maximum 50 characters.
Note: If a new lead is being created through the call (lead Id is not passed), the caller source will update the lead source with the value that you pass here.

DestinationNumber

This is the destination telephone number. In case of an inbound call, the destination phone number is the agent’s phone number. In case of an outbound call, the destination number is the Lead’s phone number.

DisplayNumber

This is the IVR number.

StartTime

The start time of the conversation in UTC (YYYY-MM-DD HH:MM:SS)

EndTime

The end time of the conversation in UTC (YYYY-MM-DD HH:MM:SS).

CallDuration

This is the duration of the call in second(s).

Status

This is the call status. This can be “Answered”, “Missed” and so on.

Direction

This is the direction of the call. This can be inbound or outbound.

CallSessionId

This is the unique Id of the call session.

LeadId

This is the unique Id of a lead.

UserId

This is the unique Id of the LeadSquared user you want to associate to the Lead. Use the Get Users API under User Management to retrieve this value.

Response

200 OK
Content-Type: application/json
{  
   "Status":"Success",
   "Message":{  
      "Id":"Id",
      "Message":"Phone call logged successfully"
   }
}

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

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