Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Change History

Document owner

Junaid Nazir

Document reviewer

Kaushal Puri Sabarinath Sunil Abhishek Srivastava

Document Status

Status
colourBlue
titledraft
/
Status
colourYellow
titlein review
/
Status
colourGreen
titleapproved

Payload Details and Format

The endpoint will be provided with the call details in following format. Few fields will only be added if corresponding data is available. For example,

Format

Code Block
languagejson
{
  "body": {
    "phonon-uuid": "6629a6f5-af55-41e8-a8a4-9b7b73fcf5c4", 
    "callDetails": [
      {
        "cdrId": "81e35a21-7b55-4142-9493-9613c02f0cae##pbx-9",
        "startTime": "2022-11-29T23:49:00.08+05:30",
        "connectTime": "2022-11-29T23:49:13.901+05:30",
        "endTime": "2022-11-29T23:51:19.131+05:30",
        "calleeNumber": "916262772728",
        "didNumber": "912243692987",
        "hangupCause": "16",
        "duration": "125230",
        "dtmfPressesd": [
          {
            "key": "6",
            "eventTime": "2022-11-29T23:49:19.912+05:30",
            "label": ""
          }
        ],
        "incoming": false,
        "calleeType": "VISITOR",
        "remoteHangup": true,
        "is_ringing": "true",
        "ringingStartTime": "2023-04-21T16:17:36.014+05:30",
        "foreignCallIds": [
          
        ]
      },
      {
        "cdrId": "c9d4bd2d-c3f7-4aa2-b236-cd06581b4c14##pbx-9",
        "startTime": "2022-11-29T23:49:21.414+05:30",
        "endTime": "2022-11-29T23:49:56.012+05:30",
        "calleeNumber": "916262772728",
        "didNumber": "+912243692987",
        "hangupCause": "5",
        "duration": "0",
        "dtmfPressesd": [
          
        ],
        "incoming": false,
        "calleeType": "HARD_PHONE",
        "remoteHangup": true,
        "foreignCallIds": [
          
        ]
      }
    ],
    "smsDetails": [
      {
        "id": "7aab92c3-65cf-4213-bc85-fde81c5580a9",
        "text": "Welcome to Phonon. Test Verified SMS  $flow.key.response_status\t\n$flow.key.response_status_code\t\n$flow.key.response_duration\t\n$flow.key.response_raw\t\n$flow.key.response_error.Phonon.Phonon",
        "to": "918238217798",
        "from": "Phonon",
        "sendTime": "2022-11-29T23:51:19.024+05:30",
        "deliveryStatus": "SENT_TO_QUEUE"
      }
    ],
    "emailDetails": [
      {
        "id": "95c54b25-a9a0-4b10-9de1-6fd9358becd6",
        "subject": "This is the Email Subject",
        "content": "<span>This is the Email Body</span>",
        "from": "abhinandan@phonon.io",
        "size": 0.04,
        "addresses": [
          {
            "id": "customer@phonon.io",
            "type": "TO",
            "deliveryStatus": "SENT_TO_QUEUE"
          }
        ],
        "sendTime": "2022-11-29T23:51:18.937+05:30"
      },
      {
        ...
      }
    ],
    "keys": [
      {
        "name": "$flow.key.CampaignName",
        "value": "bkt_x_ack"
      },
      {
        ...
      }
    ],
    "recordingUrls": [
      {
        "recordedFileName": "call_1896_20201_+912243692987_+916262772728_916262772728_6629a6f5-af55-41e8-a8a4-9b7b73fcf5c4_29112022234900_29112022235119.mp3",
        "recordedFilePublicPath": "https://central-recording.s3.ap-south-1.amazonaws.com/callrecords/1896/2022/NOVEMBER/call_1896_20201_%2B912243692987_%2B916262772728_916262772728_6629a6f5-af55-41e8-a8a4-9b7b73fcf5c4_29112022234900_29112022235119.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20221129T182121Z&X-Amz-SignedHeaders=host&X-Amz-Expires=604800&X-Amz-Credential=AKIAJAVTO5KTOHGAIHWA%2F20221129%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=2aee86cb3782b4f9e39797743c18238c344cf0570c24d68616a7d649a401f46b"
      },
      {
        ...
      }
    ]
  }
}

Explanation

Code Block
languagenone

Phonon UUID - Uniquely references this record
Array of each call leg. Optional. please note that this parameter will not be included if no calls are sent

Unique CDR ID of each leg
Start time of the call leg
Connect time, in ISO8601 Format
End time of the call leg
A Party number
Telephony number on which or from which the call was connected with the user
Hangup cause - 16 means connected call. 5 means busy, etc.
Duration of the call leg in milliseconds
Array of each DTMF pressed along with timestamp






Inbound - True, Outbound - False
VISITOR - Customer leg, AGENT - agent leg
Call was disconnected by this callee or the other end.
is_ringing will be accurately work with BSNL Mobile DIDs.









Hangup Cause 5 Busy - Agent disconnected the incoming call




This was an outbound call
Agent was logged in using mobile phone
Call was disconnected by system





SMS Details, please note that this parameter will not be included if no SMSs are sent in the "Start" flow

Reference ID of the SMS
SMS Text
Sent To
Sender ID
Sent Time
Current Delievery Status


SMS Details, please note that this parameter will not be included if no SMSs are sent in the "Start" flow

Reference ID of the Email
Subject
Body
From
Size in kilobyte
Array of each reciepient of the email


TO/CC/BCC









Keys - Array of each Flow Variable

Name of the flow variable
Value at the end of the flow





Recording URLs

Name
Public Link - valid for 7 days. Cannot be increased.






Please note that parameters are only populated if associated data is available. So if no calls are triggered (for any reason) callDetails will not populate. Please ensure all parameters are set as optional on your receiving API.

Additional Questions / Resources

If you want a custom API format to be called:

You can send call details in the API format of your choice by using the Webhook Widget, and using the System Flow Variables to dynamically add data in the “Body” or API Endpoint. Please refer to Variables In Central for full list of available variables. Please note that it will not include all variables as available in the standard webhook push.

On Flow Complete is not included!

Please note that any widgets executed post-call completion using On Flow Complete are not included here, as the API is called as soon as the Start Flow is completed.

Disposition Data is also not included as of now.