SDK reference · Python SDK
prov.account.add_text_consent_screenshot
prov.account.add_text_consent_screenshot in Python SDK. Slice 6: under We have it, a screenshot (PNG or JPEG, up to 5 MB) of how people agree to your texts; up to five.
Signature
prov.account.add_text_consent_screenshot(image: bytes, content_type: str = …) -> AnyParameters
imagebytesRequiredcontent_typestr
Returns
Any The screenshot's record.
HTTP operation
POST /v1/account/text_consent/screenshots: Add an opt-in screenshot
Errors
- authentication_required
- consent_evidence_too_large
- insufficient_role
- parameter_invalid
- plan_required
- rate_limit_exceeded
- text_consent_mode_mismatch
- text_consent_screenshots_full
- text_consents_unavailable
Example
import { readFile } from "node:fs/promises";
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/account/text_consent/screenshots`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "image/png" },
body: await readFile("signup-form.png"),
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
with open("signup-form.png", "rb") as f:
data = httpx.post(
f"{api}/v1/account/text_consent/screenshots",
headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}", "Content-Type": "image/png"},
content=f.read(),
).json()