SDK reference · Python SDK
prov.authorize.calls.relay_code
prov.authorize.calls.relay_code in Python SDK. The last resort: a code and a short address the caller relays to its person.
Signature
prov.authorize.calls.relay_code(check_id: str) -> AnyParameters
check_idstrRequired
Request fields
idstringpathRequired- The check's ID (
ccx_).
Returns
Any The code and the address.
HTTP operation
POST /v1/authorize/call_checks/{id}/relay_codes: Issue a relayed code
Errors
- parameter_invalid
- authentication_required
- insufficient_scope
- resource_missing
- rate_limit_exceeded
- calls_not_configured
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/call_checks`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({ "from": "+14155550178", "to": "+14155550123", "code": "123456" }),
})).json();
const checkId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/call_checks/${checkId}/relay_codes`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/authorize/call_checks", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"from": "+14155550178",
"to": "+14155550123",
"code": "123456"
}).json()
check_id = step1["id"]
data = httpx.post(f"{api}/v1/authorize/call_checks/{check_id}/relay_codes", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()