تلفن ابری
مدیریت تماسها و داخلیها
برقراری تماس
برقراری تماس از مبدأ به شماره مقصد.
POST
/callsAuthentication
bearerRequest body
| Name | Type | Description |
|---|---|---|
fromRequired | string | شماره مبدأ |
toRequired | string | شماره مقصد |
Response
درخواست موفق
| Name | Type | Description |
|---|---|---|
id | string | شناسه تماس |
status | string | وضعیت تماس |
duration | integer | مدت تماس بر حسب ثانیه |
request.js
const response = await fetch("https://api.example.invalid/v1/calls", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"from": "101",
"to": "+982100000000"
})
});
const data = await response.json();Response
{
"id": "call_01",
"status": "queued",
"duration": 0
}گزارش تماس
دریافت اطلاعات و وضعیت تماس.
GET
/calls/{callId}Authentication
bearerPath parameters
| Name | Type | Description |
|---|---|---|
callIdRequired | string | شناسه یکتا |
Response
درخواست موفق
| Name | Type | Description |
|---|---|---|
id | string | شناسه تماس |
status | string | وضعیت تماس |
duration | integer | مدت تماس بر حسب ثانیه |
request.js
const response = await fetch("https://api.example.invalid/v1/calls/id_01", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();Response
{
"id": "call_01",
"status": "queued",
"duration": 0
}فهرست داخلیها
دریافت فهرست داخلیهای تلفن ابری.
GET
/extensionsAuthentication
bearerResponse
درخواست موفق
| Name | Type | Description |
|---|---|---|
id | string | شناسه داخلی |
number | string | شماره داخلی |
request.js
const response = await fetch("https://api.example.invalid/v1/extensions", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();Response
[
{
"id": "ext_01",
"number": "101"
}
]