公司 DNC (請勿來電) 清單可讓您封鎖直接手動撥出的外撥電話,以及透過 Apps API 建立的外撥電話和排定時間的電話。
Contact Center AI Platform (CCAI Platform) Apps API 提供下列三個 DNC 端點:
將電話號碼新增至「謝絕來電」清單
| 參數 | 必填 | 資料類型 | 定義 |
|---|---|---|---|
| 聯絡人 | TRUE | 陣列聯絡人 | 聯絡人陣列。每個聯絡人都有 `phone_number` 屬性,以及選用的 `expires_at` 屬性 |
端點:
Method: POST
Type: RAW
URL: https://{subdomain}.{domain}/apps/api/v1/outbound_dialer/dnc
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
內文:
{
"contacts": [
{
"phone_number": "+1-7187309219",
"expires_at": "2022-10-29 00:00:00 UTC"
},
{
"phone_number": "+1-(358)-213-1634"
}
]
}
要求和回應範例
下列各節提供端點的要求範例。
將部分聯絡人新增至 DNC 清單
這個範例顯示如何將聯絡人新增至 DNC 清單。
要求
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
內文:
{
"contacts": [
{
"phone_number": "+1-7187309219",
"expires_at": "2022-10-29 00:00:00 UTC"
},
{
"phone_number": "+1-(358)-213-1634"
},
{
"phone_number": "+1-4151113333",
"expires_at": "2022-10-30 00:00:00 UTC"
},
{
"phone_number": "+1-4151115555"
},
{
"phone_number": "+1-7187309219",
"expires_at": "2022-10-27 00:00:00 UTC"
},
{
"phone_number": "sssssss"
},
{
"phone_number": "911",
"expires_at": "2023-02-05 00:00:00 UTC"
}
]
}
回應
[
{
"phone_number": "+1-7187309219",
"expires_at": "2022-10-29 00:00:00 UTC",
"status": "created"
},
{
"phone_number": "+1-(358)-213-1634",
"status": "created"
},
{
"phone_number": "+1-4151113333",
"expires_at": "2022-10-30 00:00:00 UTC",
"status": "updated"
},
{
"phone_number": "+1-4151115555",
"status": "updated"
},
{
"phone_number": "+1-7187309219",
"expires_at": "2022-10-27 00:00:00 UTC",
"error": "expires_at cannot be past date/time",
"status": "failed"
},
{
"phone_number": "sssssss",
"error": "phone_number is invalid",
"status": "failed"
},
{
"phone_number": "911",
"expires_at": "2023-02-05 00:00:00 UTC",
"error": "emergency phone number is not allowed",
"status": "failed"
}
]
Code: 200
從拒絕來電清單中移除號碼
| 參數 | 必填 | 資料類型 | 定義 |
|---|---|---|---|
| phone_numbers | TRUE | 陣列字串 | 這個陣列包含應從 DNC 清單中移除的電話號碼。 |
端點:
Method: POST
Type: RAW
URL: https://{subdomain}.{domain}/apps/api/v1/outbound_dialer/dnc/remove
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
內文:
{
"phone_numbers": [
"1-415-111-1111"
]
}
要求和回應範例
下列各節提供端點的要求範例。
移除電話號碼清單
這個範例說明如何從清單中移除電話號碼。
要求
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
內文:
{
"phone_numbers": [
"1-415-111-1111",
"1-415-222-2222",
"1-415-333-333-3333"
]
}
回應:成功
{}
狀態碼:200
檢查電話號碼是否在「謝絕來電」清單中
| 參數 | 必填 | 資料類型 | 定義 |
|---|---|---|---|
| phone_number | TRUE | 字串 | 要檢查是否在謝絕來電清單中的電話號碼 |
端點:
Method: GET
Type:
URL: URL: https://{subdomain}.{domain}/apps/api/v1/outbound_dialer/dnc/check?phone_number={phone_number}
標題:
無
內文:
無
要求和回應範例
下列各節提供端點的要求範例。
檢查號碼是否在 DNC 清單中
這個範例說明如何檢查電話號碼是否在 DNC 清單中。
要求
| 鍵 | 值 |
|---|---|
| phone_number | {PHONE_NUMBER} (數字):終端使用者的電話號碼。 |
GET https://{subdomain}.{domain}/apps/api/v1/outbound_dialer/dnc/check?phone_number={PHONE_NUMBER}
回應
{
"phone_number": "1-415-111-1111",
"expired_at": "2023-08-05 22:02:36.362009 +0000"
"do_not_call": true
}
Code: 200