View as Markdown

SDK reference · Python SDK

prov.account.import_text_consents

prov.account.import_text_consents in Python SDK. Slice 2: import a CSV of phones that agreed to your texts (mode company, Pro and up): the columns phone, method, obtained_at and, optionally, evidence_url; up to 50,000 rows and 5 MB.

Signature

prov.account.import_text_consents(csv: 'bytes | str', file_name: Optional[str] = …) -> Any

Parameters

csv'bytes | str'Required
file_nameOptional[str]

Request fields

file_namestringquery
The file's name, shown on the import (a form post's own file name is used otherwise).

Returns

Any The same file was sent within a day; this is the earlier import, and nothing new was written.

HTTP operation

POST /v1/account/text_consent_imports: Import consents to text from a CSV

Errors

Example

import { readFile } from "node:fs/promises";

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/account/text_consent_imports?file_name=consents.csv`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "text/csv" },
  body: await readFile("consents.csv"),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.