نمونه درخواستها
ارسال کد تایید صوتی
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": 45,
"limit": 45,
"musiconhold": "musiconhold-default-1",
"callback_url": "https://example.com/webhook",
"retry_count": 0,
"retry_delay_seconds": 30
}
نمونه پاسخ:
{
"ok": true,
"data": {
"request_id": "6319a18f-6e51-4e0f-927b-44e1c7fa0eb1",
"endpoint_number": "02191010001",
"musiconhold": "musiconhold-default-1",
"status": "accepted"
},
"billing": {
"charged": 120,
"unit_price": 120,
"remaining_credit": 9880
}
}
استعلام صوتهای انتظار سرویس
https://voipano.com/api/v1/webservice/music-on-holds
نمونه درخواست JSON:
GET /api/v1/webservice/music-on-holds
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
{
"ok": true,
"data": {
"endpoint_number": "2191305383",
"items": [
{
"name": "musiconhold-2191305383-1",
"musiconhold": "musiconhold-2191305383-1",
"description": "موسیقی انتظار فروش",
"mode": "files",
"is_public": false
}
],
"total": 1
},
"billing": {
"charged": 0,
"unit_price": 0
}
}
دریافت گزارش تماس
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
لیست و جستجوی مخاطبین
https://voipano.com/api/v1/webservice/contacts
نمونه درخواست JSON:
GET /api/v1/webservice/contacts?search=0912&page=1&per_page=20
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
{
"ok": true,
"data": { "items": [], "pagination": { "page": 1, "per_page": 20 } },
"billing": { "charged": 0 }
}
مشاهده مخاطب
https://voipano.com/api/v1/webservice/contacts/{contactId}
نمونه درخواست JSON:
GET /api/v1/webservice/contacts/CONTACT_ID
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
{ "ok": true, "data": { "contact": { "id": "..." } }, "billing": { "charged": 0 } }
ایجاد مخاطب
https://voipano.com/api/v1/webservice/contacts
نمونه درخواست JSON:
POST /api/v1/webservice/contacts
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"first_name": "علی",
"primary_number": "09120000000"
}
نمونه پاسخ:
{ "ok": true, "data": { "contact": { "id": "..." } }, "billing": { "charged": 0 } }
ویرایش مخاطب
https://voipano.com/api/v1/webservice/contacts/{contactId}
نمونه درخواست JSON:
PATCH /api/v1/webservice/contacts/CONTACT_ID
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{ "organization": "شرکت ویپانو" }
نمونه پاسخ:
{ "ok": true, "data": { "contact": { "id": "..." } }, "billing": { "charged": 0 } }
حذف مخاطب
https://voipano.com/api/v1/webservice/contacts/{contactId}
نمونه درخواست JSON:
DELETE /api/v1/webservice/contacts/CONTACT_ID
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
{ "ok": true, "data": { "id": "...", "deleted": true }, "billing": { "charged": 0 } }
درونریزی گروهی مخاطبین
https://voipano.com/api/v1/webservice/contacts/bulk-import
نمونه درخواست JSON:
POST /api/v1/webservice/contacts/bulk-import
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{ "contacts": [{ "first_name": "علی", "primary_number": "09120000000" }], "update_existing": true }
نمونه پاسخ:
{ "ok": true, "data": { "submitted": 1, "result": {} }, "billing": { "charged": 0 } }
لیست گروههای مخاطب
https://voipano.com/api/v1/webservice/contact-groups
نمونه درخواست JSON:
GET /api/v1/webservice/contact-groups
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
{ "ok": true, "data": { "items": [] }, "billing": { "charged": 0 } }
ایجاد گروه مخاطب
https://voipano.com/api/v1/webservice/contact-groups
نمونه درخواست JSON:
POST /api/v1/webservice/contact-groups
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{ "name": "مشتریان" }
نمونه پاسخ:
{ "ok": true, "data": { "group": { "id": "..." } }, "billing": { "charged": 0 } }
حذف گروه مخاطب
https://voipano.com/api/v1/webservice/contact-groups/{groupId}
نمونه درخواست JSON:
DELETE /api/v1/webservice/contact-groups/GROUP_ID
Authorization: Bearer YOUR_TOKEN
نمونه پاسخ:
{ "ok": true, "data": { "id": "...", "deleted": true }, "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,
'musiconhold' => 'musiconhold-default-1',
'callback_url' => 'https://example.com/webhook',
'retry_count' => 0,
'retry_delay_seconds' => 30,
];
$response = $client->post('https://voipano.com/api/v1/webservice/secure-call', [
'headers' => $headers,
'json' => $body,
]);
echo $response->getBody();