نمونه درخواستها
ارسال کد تایید صوتی
https://voipano.com/api/v1/webservice/call-otp
نمونه درخواست JSON:
{
"phone_number": "09123***789",
"purpose": "login",
"client_ref": "req-otp-1001"
}
نمونه پاسخ:
{
"ok": true,
"data": {
"request_id": "3dfd4fd4-5a2e-42a7-8f51-944fe18ca81a",
"phone_number": "09123***789",
"purpose": "login",
"message": "کد تایید ارسال شد."
},
"billing": {
"charged": 160,
"unit_price": 160,
"remaining_credit": 9840
}
}
تماس سریع
https://voipano.com/api/v1/webservice/click-to-call
نمونه درخواست JSON:
{
"call_source": "09123***789",
"call_destination": "09129***543",
"timeout": 30,
"limit": 45
}
نمونه پاسخ:
{
"ok": true,
"data": {
"request_id": "7c8f3dd6-18c7-4e34-94bf-009d019f1d58",
"endpoint_number": "02191010001",
"status": "accepted",
"provider": {
"success": true,
"status": 201
}
},
"billing": {
"charged": 80,
"unit_price": 80,
"remaining_credit": 9920
}
}
تماس امن
https://voipano.com/api/v1/webservice/secure-call
نمونه درخواست JSON:
{
"call_source": "09123***789",
"call_destination": "09129***543",
"timeout": 30,
"limit": 30
}
نمونه پاسخ:
{
"ok": true,
"data": {
"request_id": "6319a18f-6e51-4e0f-927b-44e1c7fa0eb1",
"endpoint_number": "02191010001",
"status": "accepted"
},
"billing": {
"charged": 120,
"unit_price": 120,
"remaining_credit": 9880
}
}
دریافت گزارش تماس
https://voipano.com/api/v1/webservice/call-reports
نمونه درخواست JSON:
GET /api/v1/webservice/call-reports?has_recording=1&limit=10&page=1
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
{
"ok": true,
"data": {
"endpoint_number": "02191010001",
"items": [
{
"id": "67bc8ea2f8f8a7d1287995f1",
"call_details_record_id": "67bc8ea2f8f8a7d1287995f1",
"call_source": "09123***789",
"call_destination": "09129***543",
"has_recording": true,
"recording_url": "https://example.com/api/v1/webservice/call-recordings/67bc8ea2f8f8a7d1287995f1?call_details_record_id=67bc8ea2f8f8a7d1287995f1"
}
],
"pagination": {
"page": 1,
"per_page": 10,
"total": 32,
"last_page": 4
}
},
"billing": {
"charged": 0,
"unit_price": 0
}
}
دریافت لیست سرویسها
https://voipano.com/api/v1/webservice/services
نمونه درخواست JSON:
GET /api/v1/webservice/services
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
{
"ok": true,
"data": {
"items": [
{
"subscription_id": 12,
"status": "active",
"remaining_days": 26,
"package": {
"id": 2,
"name": "پلن پیوند",
"slug": "peyvand"
},
"phone_number": "002191010001"
}
],
"total": 1
},
"billing": {
"charged": 0,
"unit_price": 0
}
}
دریافت لیست صندوق صوتی
https://voipano.com/api/v1/webservice/voicemail-inboxes
نمونه درخواست JSON:
GET /api/v1/webservice/voicemail-inboxes?context=voicemail-02191010001&limit=20
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
{
"ok": true,
"data": {
"items": [
{
"id": "67bc8f2df8f8a7d12879960f",
"mailbox": "1001",
"context": "voicemail-02191010001",
"fullname": "Ali"
}
],
"allowed_contexts": [
"voicemail-02191010001",
"voicemail-user-15"
]
},
"billing": {
"charged": 0,
"unit_price": 0
}
}
دریافت صوت یک مکالمه
https://voipano.com/api/v1/webservice/call-recordings/{cdrId}
نمونه درخواست JSON:
GET /api/v1/webservice/call-recordings/67bc8ea2f8f8a7d1287995f1?call_details_record_id=67bc8ea2f8f8a7d1287995f1
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
HTTP/1.1 200 OK
Content-Type: audio/wav
Content-Disposition: attachment; filename="recording-67bc8ea2f8f8a7d1287995f1.wav"
X-Billing-Charged: 0
دریافت فایل صندوق صوتی
https://voipano.com/api/v1/webservice/voicemail-recordings/{uniqueId}
نمونه درخواست JSON:
GET /api/v1/webservice/voicemail-recordings/1739558127.155?context=voicemail-02191010001&mailbox=1001
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
HTTP/1.1 200 OK
Content-Type: audio/wav
Content-Disposition: attachment; filename="voicemail-1739558127.155.wav"
X-Billing-Charged: 0
نمونه PHP (تماس امن)
https://voipano.com/api/v1/webservice/secure-call
$client = new \GuzzleHttp\Client();
$headers = [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
];
$body = [
'call_source' => '0912***6789',
'call_destination' => '0912***9876',
'timeout' => 30,
'limit' => 30,
];
$response = $client->post('https://voipano.com/api/v1/webservice/secure-call', [
'headers' => $headers,
'json' => $body,
]);
echo $response->getBody();