Skip to main content

Send call log details

Please make sure you have an API up and running, similar to the endpoint shown below where 'your-custom-url' is your company domain. Onoff suggest to add an api-key as described in Authorization.

 POST https://<your-custom-url>/v1/onoff/cdr 

Request

Body example

{
"id": "12345",
"eventName": "CDR",
"onoffUserName": "John Doe",
"onoffUserEmail": "john.doe@example.com",
"onoffUserNumber": "1234567890",
"externalNumber": "0987654321",
"externalName": "John Smith",
"externalEmail": "smith@example.com",
"callStarted": "2023-05-20T14:30:00Z",
"callEnded": "2023-05-20T14:32:00Z",
"callDuration": 300,
"callDirection": "INBOUND",
"callStatus": "ANSWERED",
"callNotes": "Important notes about the call",
"voicemailUrl": "http://example.com/voicemail/12345",
"voicemailDuration": 60,
"callRecordingUrl": "http://example.com/recordings/12345",
"tags":[{"tagId":"17431723-0001","tagName":"Blue","tagColor":"#32A8FF"}]
}

Field explanation

  • id String Unique id of the call log details
  • eventName String This is the type of the event sent. Currently, the values are CDR for normal call log, VM for voicemail, RECORDING for a call recording. Please note that if Call recording option is enabled, then CDR is not sent because is same info with the additional callRecording field.
  • onoffUserName String Username of the onoff user who is involved in the call
  • onoffUserEmail String Email of the onoff user who is involved in the call
  • onoffUserNumber String Phone number of the person who has Onoff account
  • externalNumber String Phone number of the second party
  • externalName String If the second party is in the contacts of the onoff user, then the first and last name will be sent. Otherwise, will not be sent
  • externalEmail String If the second party is in the contacts of the onoff user, then the contact email will be sent. Otherwise, will not be sent-
  • callStarted Date Date when the call started
  • callEnded Date Date when the call ended
  • callDuration Integer Duration of the call in seconds if available. If the call log details is a voicemail, then this field is not sent
  • callDirection String The direction of the call. The possible values are INBOUND, OUTBOUND
  • callStatus String The status of the call. The possible values are MISSED_CALL, ANSWERED, BUSY, WRONG_NUMBER, VMS, UNKNOWN
  • callNotes String If the onoff user added notes during the call, this field will be sent. Otherwise will not be sent
  • voicemailUrl String If the call log is actually a voicemail, a url will be sent with the audio of the call. Otherwise will not be sent
  • voicemailDurationInteger If the call log is actually a voicemail, the duration of the voicemail in seconds if available will be sent. Otherwise will not be sent
  • callRecordingUrl String If the admin in b2b console enables call recording, an url will be sent with the audio of the call. Otherwise will not be sent
  • tags Array If the onoff user added tags during the call, this field will have a list of items, each having tagId, tagName, and tagColor. Otherwise will not be sent

Response

An empty Json or String is fine for us. What is important is that the HTTP Status in the response is 200 OK.

Body example

{
}

Errors

If after onoff makes the request to your specific domain, we receive 4xx or 5xx HTTP Status in the response, we will retry 4 times more to deliver the event info. After the last attempt, we do not succeed in the delivery, onoff will discard the log meaning it will be lost.

Recommendations

  • Idempotency: We look forward for you to implement a webhook in idempotent manner to avoid duplications in your side. A better explanation about the concept of idempotency here. Just note that each event that we send you has an unique UUID so that you can verify if it was processed before or not.

  • Timeouts: We expect your service to handle requests properly. Our service make request with the following timeouts

    • Connect timeout: 1000 ms
    • Read timeout: 10000 ms