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
Property | Type | Description |
---|---|---|
appid | number | Your app id |
conversation_uuid | string | A unique identifier of this conversation |
direction | string | Direction of this call |
from | number | The number who made a call |
leg | string | Define the leg of the call either a or b |
status | string | Status of this call |
time | number | Timestamp of this call |
to | number | Your incoming DID number |
cmiuuid | string | A unique identifier of this call |
extra_params | string | Your 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.
- 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.