SDK reference · Python SDK
prov.authorize.calls.check
prov.authorize.calls.check in Python SDK. Check an incoming call (from_ is the calling number; from is a Python keyword).
Signature
prov.authorize.calls.check(from_: str, to: str, at: Optional[str] = …, code: Optional[str] = …, challenge: Optional[bool] = …, wait: Optional[int] = …) -> AnyParameters
from_strRequiredtostrRequiredatOptional[str]codeOptional[str]challengeOptional[bool]waitOptional[int]
Request fields
fromstringRequired- The caller ID, in E.164.
tostringRequired- The number that was called, in E.164.
attimestamp- When the call came in. Default now.
codestring- The caller's 6-digit short code. Needed when
toisn't one of your verified lines. challengeboolean- With nothing registered, issue an in-call challenge and ask the operator that verified
fromfor proof. waitinteger- Seconds to wait for proof after a challenge. Default 20.
Returns
Any The verdict.
HTTP operation
POST /v1/authorize/call_checks: Check an incoming call
Errors
- parameter_invalid
- parameter_missing
- authentication_required
- insufficient_scope
- call_line_unverified
- trial_ended
- spend_cap_reached
- rate_limit_exceeded
- calls_not_configured
Example
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/call_checks`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
body: JSON.stringify({ "from": "+14155550100", "to": "+14155550123" }),
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/call_checks", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
"from": "+14155550100",
"to": "+14155550123"
}).json()