View as Markdown

SDK reference · Node SDK

prov.account.importTextConsents

prov.account.importTextConsents in Node 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.importTextConsents(file: string | Uint8Array | Blob, opts?: { fileName?: string }): Promise<TextConsentImport>

Parameters

filestring | Uint8Array | BlobRequired
opts{ fileName?: string }

Request fields

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

Returns

Promise<TextConsentImport> 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.