Remove a DND number
curl --request DELETE \
--url https://api.osvi.ai/v1/dnd_numbers \
--header 'API-Token: <api-key>'import requests
url = "https://api.osvi.ai/v1/dnd_numbers"
headers = {"API-Token": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'API-Token': '<api-key>'}};
fetch('https://api.osvi.ai/v1/dnd_numbers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.osvi.ai/v1/dnd_numbers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"API-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.osvi.ai/v1/dnd_numbers"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("API-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.osvi.ai/v1/dnd_numbers")
.header("API-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.osvi.ai/v1/dnd_numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["API-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Phone removed from DND list"
}{
"success": false,
"error": "param is missing or the value is empty: phone",
"details": null
}{
"success": false,
"error": "Invalid API token"
}{
"success": false,
"error": "Phone number not found on DND list",
"details": null
}Do Not Disturb
Remove DND Number
Removes a number from an agent’s do-not-disturb list. The agent may call the number again afterwards.
DELETE
/
v1
/
dnd_numbers
Remove a DND number
curl --request DELETE \
--url https://api.osvi.ai/v1/dnd_numbers \
--header 'API-Token: <api-key>'import requests
url = "https://api.osvi.ai/v1/dnd_numbers"
headers = {"API-Token": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'API-Token': '<api-key>'}};
fetch('https://api.osvi.ai/v1/dnd_numbers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.osvi.ai/v1/dnd_numbers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"API-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.osvi.ai/v1/dnd_numbers"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("API-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.osvi.ai/v1/dnd_numbers")
.header("API-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.osvi.ai/v1/dnd_numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["API-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Phone removed from DND list"
}{
"success": false,
"error": "param is missing or the value is empty: phone",
"details": null
}{
"success": false,
"error": "Invalid API token"
}{
"success": false,
"error": "Phone number not found on DND list",
"details": null
}Authorizations
16-character API token associated with your OSVI account. Find it in your dashboard under Settings → API.
⌘I
