Post a Call Log (Async)

Posts a call log to LeadSquared. The API URL and post data differ based on the installed LeadSquared telephony connector (Universal Telephony Connector, Generic Telephony Connector, etc.) and the telephony provider (Ozonetel, Super Receptionist, etc.). To get the API URL and post data –

  1. In your account, navigate to Apps>Apps Marketplace.
  2. Search for and select the connector (e.g., Universal Telephony Connector).
  3. Click Settings>Configure.
  4. On the configuration pop-up, click Call Log API.

Call log APIs

The functionality is the same as the synchronous Call Log APIs, with the following differences –

  1. API host is different, see Async API. For example, if the current host is telephony.leadsquared.com, here the host will be api-async.leadsquared.com.
  2. The API URL will be slightly different for the Universal Telephony Connector and for other connectors.
  3. An additional x-api-key must be passed in the header. See Async API to get the key. If the key is not passed in the header, the request will not be accepted.
  4. Returns a RequestId parameter. This must be passed in the Status API to get the status of the request.

 

All Connectors

Existing URL https://telephony.leadsquared.com/1/api/Telephony/LogCallComplete/159f38f24a332f0c44374f8ebf0fc2bf7d
URL https://{async-host}/1/api/telephony/logcallcomplete/159f38f24a332f0c44374f8ebf0fc2bf7d
Header x-api-key: <generated-api-key>
Request Body See example request below.


UTC Connector

Note that the URL is different since UTC has a different URL format. Everything else remains the same.

Existing URL https://telephony-in21.leadsquared.com/1/api/Telephony/LogCallComplete/2477c2666e04a5122d6e61787c5c55c250/c378b61d-e30c-4c45-a436-f08c4fce1edf
URL https://{async-host}/1/api/telephony/logcallcomplete/2477c2666e04a5122d6e61787c5c55c250/c378b61d-e30c-4c45-a436-f08c4fce1edf

 

API URL

POST
https://{async-host}/1/api/telephony/logcallcomplete/159f38f24a332f0c44374f8ebf0fc2bf7d
Copy URL

Request

JSON Body/Payload

Content-Type: application/json

{
   "SourceNumber":"9611795983",
   "DestinationNumber":"9611795980",
   "DisplayNumber":"9020897874",
   "StartTime":"2015-08-20 18:26:38",
   "EndTime":"2015-08-20 18:26:38",
   "CallDuration":"12",
   "Status":"Answered",
   "CallNotes":"Enquired about product",
   "ResourceURL":"server/filename.extension",
   "Direction":"Inbound",
   "CallSessionId":"080673309211440075398",
   "AgentName":"Test"
}

JSON Properties

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.

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

This is the start time of the conversation.

EndTime

This is the end time of the conversation.

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.

CallNotes

Notes posted that are related to the call.

ResourceURL

URL of the resource where the call log is posted.

Direction

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

CallSessionId

This is the unique Id of the call session.

AgentName

The name of the agent who made/received the call.

Response

200 OK

Content-Type: application/json

{
   "Status":"Request accepted. Please use below request id to check the status",
   "RequestID":"8eca6fa6-262c-43eb-8cfe-6e3325e2dc73"
}

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.