List recent test runs
curl --request GET \
--url https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history', 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.optimaldial.com/api/v1/spam/numbers/{number_id}/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.optimaldial.com/api/v1/spam/numbers/{number_id}/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"number_id": "<string>",
"phone_number": "+15551234567",
"results": [
{
"test_run_id": "<string>",
"carrier": "<string>",
"status": "pending",
"screenshot_available": true,
"tested_at": "2023-11-07T05:31:56Z",
"spam_detected": true,
"spam_label": "<string>",
"sip_response_code": "<string>",
"caller_id_verified": true
}
],
"total": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": {
"error": "rate_limit_exceeded",
"scope": "per_key",
"limit": 123,
"retry_after_seconds": 123
}
}spam
List recent test runs
Returns the number’s test runs from the last 7 days, newest first.
GET
/
api
/
v1
/
spam
/
numbers
/
{number_id}
/
history
List recent test runs
curl --request GET \
--url https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history', 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.optimaldial.com/api/v1/spam/numbers/{number_id}/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.optimaldial.com/api/v1/spam/numbers/{number_id}/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.optimaldial.com/api/v1/spam/numbers/{number_id}/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"number_id": "<string>",
"phone_number": "+15551234567",
"results": [
{
"test_run_id": "<string>",
"carrier": "<string>",
"status": "pending",
"screenshot_available": true,
"tested_at": "2023-11-07T05:31:56Z",
"spam_detected": true,
"spam_label": "<string>",
"sip_response_code": "<string>",
"caller_id_verified": true
}
],
"total": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": {
"error": "rate_limit_exceeded",
"scope": "per_key",
"limit": 123,
"retry_after_seconds": 123
}
}Authorizations
OptimalDial API key, prefixed od_live_, sent as Authorization: Bearer ....
Mint keys in the in-app developer panel; they are scoped to a single organization.