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 StringUnique id of the call log detailseventName StringThis 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 StringUsername of the onoff user who is involved in the callonoffUserEmail StringEmail of the onoff user who is involved in the callonoffUserNumber StringPhone number of the person who has Onoff accountexternalNumber StringPhone number of the second partyexternalName StringIf the second party is in the contacts of the onoff user, then the first and last name will be sent. Otherwise, will not be sentexternalEmail StringIf the second party is in the contacts of the onoff user, then the contact email will be sent. Otherwise, will not be sent-callStarted DateDate when the call startedcallEnded DateDate when the call endedcallDuration IntegerDuration of the call in seconds if available. If the call log details is a voicemail, then this field is not sentcallDirection StringThe direction of the call. The possible values are INBOUND, OUTBOUNDcallStatus StringThe status of the call. The possible values are MISSED_CALL, ANSWERED, BUSY, WRONG_NUMBER, VMS, UNKNOWNcallNotes StringIf the onoff user added notes during the call, this field will be sent. Otherwise will not be sentvoicemailUrl StringIf the call log is actually a voicemail, a url will be sent with the audio of the call. Otherwise will not be sentvoicemailDurationIntegerIf the call log is actually a voicemail, the duration of the voicemail in seconds if available will be sent. Otherwise will not be sentcallRecordingUrl StringIf the admin in b2b console enables call recording, an url will be sent with the audio of the call. Otherwise will not be senttags ArrayIf 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