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
Property | Type | Description |
---|---|---|
appid | number | Your app id |
callerid | number | The incoming DID number |
conversation_uuid | string | A unique identifier of this conversation |
direction | string | Direction of this call |
extra_params | string | Your custom parameters |
from | number | Your default DID Number |
leg | string | Define the leg of the call either a or b |
request_id | string | The unique request ID for this call |
status | string | Status of this call |
time | number | Timestamp of this call |
to | number | The number the call was made to |
cmiuuid | string | A unique identifier of this call |
vn | number | The 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.
- Leg A
- Leg B
{
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
}
{
appid: 2222224,
callerid: 440000000000,
conversation_uuid: 'GQqYoKtV3Tn25SVqbWwdzPkNwMBo9hhLwWadm9N71N5',
direction: 'outbound',
extra_params: '{"key":"value"}',
from: 440000000000,
leg: 'b',
request_id: 'GQqYoKtV3Tn25SVqbWwdzPkNwMBo9hhLwWadm9N71N5',
status: 'out_started',
time: 1725942893683,
to: 19170000001,
cmiuuid: 'ade4153c-d8bd-4a62-bd6d-30774e0aa30a',
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.
- Node.js
- Python
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.
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.