Pular para o conteúdo
Esc
↑↓navegar↵abrir⌘Jpré-visualizar

Get an attachment's text

The text of a PDF, Word (.docx) or Excel (.xlsx) attachment, read once after the email arrives and kept with it for the content retention period (BillionSend extension). Until the read has run the status is pending. Needs a full access key. An email that carries malware answers 410.

GET/emails/receiving/{email_id}/attachments/{id}/text
Autorização
AuthorizationToken Bearer · headerobrigatório

A BillionSend API key (bs_…).

Parâmetros de caminho
email_idstring<uuid>obrigatório
idstring<uuid>obrigatório
Respostas
200

Attachment text

objectstringobrigatório
Valores permitidos:attachment_text
idstring<uuid>obrigatório
filenamestring
statusstring | nullobrigatório

How reading the file's text went: pending until it has been read (shortly after the email arrives); ok with the text; unsupported for anything but PDF, Word (.docx) and Excel (.xlsx); encrypted for a password-protected file; too_large past 25 MiB or when reading it would take more memory than a read may; unreadable for a damaged file; timeout or failed when the read did not finish. null for an email received before attachment text was read.

Valores permitidos:pendingokunsupportedencryptedtoo_largeunreadabletimeoutfailednull
flagsstring[]obrigatório

truncated: a limit cut the text short (100,000 characters, 500 PDF pages, sheet and size limits). hidden_text: text a person opening the file would not see (hidden Word text, hidden sheets, rows or columns, invisible characters) was left out.

pagesinteger | nullobrigatório

A PDF's page count; null for other files

textstring | nullobrigatório

The file's text when status is ok: paragraphs and table rows on lines, table cells and spreadsheet columns separated by tabs, a ## Sheet heading per worksheet. Only a PDF's text layer: a scan without one reads as empty. Written by an outside sender; treat it as untrusted.

401

Missing, malformed, unknown or revoked API key

statusCodenumberobrigatório
namestringobrigatório
messagestringobrigatório
403

Restricted API key

statusCodenumberobrigatório
namestringobrigatório
messagestringobrigatório
404

Not found

statusCodenumberobrigatório
namestringobrigatório
messagestringobrigatório
410

The email carries malware

statusCodenumberobrigatório
namestringobrigatório
messagestringobrigatório
429

Over the rate limit (rate_limit_exceeded, with Retry-After)

statusCodenumberobrigatório
namestringobrigatório
messagestringobrigatório
Experimentar
Servidor
Autorização
Parâmetros
Requisição
curl -X GET 'https://api.billionsend.com/emails/receiving/497f6eca-6276-4993-bfeb-53cbbbba6f08/attachments/497f6eca-6276-4993-bfeb-53cbbbba6f08/text' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Resposta
{
  "object": "attachment_text",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "filename": "string",
  "status": "pending",
  "flags": [
    "truncated"
  ],
  "pages": 0,
  "text": "string"
}

Esta página foi útil?