Outbound Webhooks Missed

To receive the outbound missed webhooks, you must complete the webhooks setup. After completing the webhooks setup, our PIOPIY platform will notify your web server POST method URL with JSON call detail record(CDR) when an incoming call missed.

Implementation

PIOPIY webhooks implementation in different languages.

from flask import Flask,request
app = Flask(__name__)
# Receive webhooks from PIOPIY platform when call receive or make
@app.route("/webhook/cdr",methods=['POST'])
def hello():
# Received JSON CDR from PIOPIY Platform
cdr = request.get_json()
print(cdr)
return "got it"
if __name__ == "__main__":
app.run(debug=True, port=5000)

To know more about testing webhooks for local development purposes, go to examples.

Sample CDR response

This is the sample JSON live event, where the PIOPIY platform will notify your web server POST method URL.

{
to: 9100000000,
appid: 2222222,
time: 1637122618000,
from: 4471000000,
extra_params: '{"key":"value"}',
direction: 'outbound',
duration: 0,
cmiuuid: '4ccdaec1-c641-4570-8440-174029adc705',
conversation_uuid: '4ccdaec1-c641-4570-8440-174029adc705',
request_id: '8u4GZN8ReZAqCDTONen4p36SfA0qBnKlrD00KlRoJZY',
callerid: '04471000000',
vn: 4471000000,
out: true,
status: 'missed',
leg: 'a',
type: 'cdr'
}

The above sample JSON live event consists of several properties. Each property has a description and take a look at it.

Properties

These are the list of properties and its description

PropertyTypeDescription
tonumberThe number the call was made to
app_idnumberYour app id
timenumberTimestamp of this call
fromnumberYour default DID Number
directionstringDirection of this call
durationnumberThe total duration of this call in seconds
cmiuuidstringA unique identifier of this call
conversation_uuidstringA unique identifier of this conversation
calleridnumberThe incoming DID number
vnnumberYour default DID Number
outstringThis call is initiated from API
statusstringStatus of this call
legstringDefine the leg of the call either a or b
typestringType of notification from PIOPIY platform it may be cdr or event