Inbound Hangup

Our PIOPIY platform will notify the following sample JSON live event to your web server POST method URL, when an inbound call is hangup.

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 event response

This is the sample JSON call detail record(CDR), where the PIOPIY platform will notify your web server POST method URL.

{
extra_params: '{key: value}',
type: 'event',
leg: 'a',
conversation_uuid: '6f4e194a-9617-43e9-9756-ad93c3ab922f',
time: 1636372054000,
to: '19170000000',
from: '440000000000',
cmiuuid: '6f4e194a-9617-43e9-9756-ad93c3ab922f',
direction: 'inbound',
appid: 2222222,
status: 'hangup'
}

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
extra_paramsstringYour custom parameters
typestringType of notification from PIOPIY platform it may be cdr or event
legstringDefine the leg of the call either a or b
conversation_uuidstringA unique identifier of this conversation
timenumberTimestamp of this call
tonumberYour incoming DID number
fromnumberThe number who made a call
cmiuuidstringA unique identifier of this call
directionstringDirection of this call
app_idnumberYour app id
statusstringStatus of this call