Skip to main content

Inbound Answered

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

Properties

These are the list of properties and its description

PropertyTypeDescription
appidnumberYour app id
conversation_uuidstringA unique identifier of this conversation
directionstringDirection of this call
fromnumberThe number who made a call
legstringDefine the leg of the call either a or b
statusstringStatus of this call
timenumberTimestamp of this call
tonumberYour incoming DID number
cmiuuidstringA unique identifier of this call
extra_paramsstringYour custom parameters

Event response

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

{
appid: 2222224,
conversation_uuid: 'a39e868b-a221-48db-ab5e-401147a5c619',
direction: 'inbound',
from: 440000000000,
leg: 'a',
status: 'in_answered',
time: 1725886117909,
to: 19170000000,
cmiuuid: 'a39e868b-a221-48db-ab5e-401147a5c619',
extra_params: '{key: value}'
}

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

Implementation

PIOPIY webhooks implementation in different languages.

const express = require("express"),
bodyParser = require("body-parser"),
app = express();

// parse application/json
app.use(bodyParser.json());

app.post("/webhook/cdr", (req, res) => {
//Received CDR JSON Object from PIOPIY platform
var cdr = req.body;

console.log(cdr);

res.send("got it");
});

app.listen(5000);
app.run((debug = True), (port = 5000));

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