Skip to main content

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 CDR (Call Detail Record) when an incoming call missed.

Properties

These are the list of properties and its description

PropertyTypeDescription
tonumberThe number the call was made to
appidnumberYour app id
timenumberTimestamp of this call
start_timenumberThe start time of this call
end_timenumberThe end time of this call
fromnumberYour default DID Number
directionstringDirection of this call
durationnumberThe total duration of this call in seconds
extra_paramsstringYour custom parameters
cmiuuidstringA unique identifier of this call
call_ratestringThe billed call rate for this call
balancestringThe total available account balance after this call
conversation_uuidstringA unique identifier of this conversation
request_idstringThe unique request ID for this call
calleridnumberThe incoming DID number
statusstringStatus of this call
legstringDefine the leg of the call either a or b

CDR response

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

{
to: 440000000000,
appid: 2222222,
time: 1632307235000,
start_time: 1632307238,
end_time: 1632307265,
from: 19170000000,
direction: 'outbound',
duration: 0,
extra_params: '{"key":"value"}',
cmiuuid: '1edceb4c-4e2c-402d-81b4-1c2f6fca442d',
call_rate: 0,
balance: '76.349024',
conversation_uuid: 'S9U4Mo29GHBfCJ2uHczcY75QQDri7HcAxXYZuktJLxf',
request_id: 'S9U4Mo29GHBfCJ2uHczcY75QQDri7HcAxXYZuktJLxf',
callerid: 19170000000,
status: 'missed',
leg: 'a'
}

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.