Skip to main content

Outbound Started

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

Properties

These are the list of properties and its description

PropertyTypeDescription
appidnumberYour app id
calleridnumberThe incoming DID number
conversation_uuidstringA unique identifier of this conversation
directionstringDirection of this call
extra_paramsstringYour custom parameters
fromnumberYour default DID Number
legstringDefine the leg of the call either a or b
request_idstringThe unique request ID for this call
statusstringStatus of this call
timenumberTimestamp of this call
tonumberThe number the call was made to
cmiuuidstringA unique identifier of this call
vnnumberThe virtual number is displayed to the customer

Event response

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

{
appid: 2222224,
callerid: 440000000000,
conversation_uuid: 'GQqYoKtV3Tn25SVqbWwdzPkNwMBo9hhLwWadm9N71N5',
direction: 'outbound',
extra_params: '{"key":"value"}',
from: 440000000000,
leg: 'a',
request_id: 'GQqYoKtV3Tn25SVqbWwdzPkNwMBo9hhLwWadm9N71N5',
status: 'out_started',
time: 1725942871456,
to: 19170000000,
cmiuuid: 'ee6a7a9b-78ea-4693-9e77-5fc085567b2f',
vn: 440000000000
}

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.