پرش به مستندات
Python

openemail.senders

هر متد در این فضای نام: امضا، پارامترها، آنچه برمی‌گرداند و یک نمونه.

متدها

What is known about the organisation behind a sender, the line the reading pane shows under an unfamiliar one, and looking a sender up.

senders.get()

Read what is known about a sender

محدوده‌های دسترسیthreads:read
امضای متد
def get(    email: str,    *,    api_key: str | None = None,    timeout: float | None = None,) -> SenderProfileResource

Returns a sentence or two about the organisation behind the domain of an address, the line the reading pane shows under an unfamiliar sender. Only the domain is read, so any address on it gives the same answer, and what is known is kept for the whole workspace.

A domain nobody has looked up yet is a 404, which raises OpenEmailApiError with is_not_found. research looks it up.

پارامترها

emailstrالزامی

An address of the sender, such as [email protected].

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds this call may take, the response included, before it raises OpenEmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

خروجی

SenderProfileResource, a dict with object set to 'sender_profile', domain, about and updatedAt.

نمونه

from openemail import OpenEmailApiError, openemail try:    sender = openemail.senders.get('[email protected]')    print(sender['domain'], sender['about'])except OpenEmailApiError as error:    if error.is_not_found:        print('Nobody has looked stripe.com up yet')    else:        raise

نکته‌ها

همچنین در دسترس در

API
GET /senders/{email}
TypeScript
senders.get()
Ruby
senders.get
CLI
openemail senders get

senders.research()

Look a sender up

محدوده‌های دسترسیthreads:read
امضای متد
def research(    email: str,    *,    api_key: str | None = None,    timeout: float | None = None,) -> SenderProfileResource

Searches the web for the organisation behind the domain of an address and keeps what it found for the whole workspace, as the reading pane does the first time it shows a sender. A domain that was looked up before is answered from what was kept, and nothing is searched again.

Only the owner of the workspace may look senders up, with a key or an app that is not limited to particular addresses or domains: anything else is a 422 capability_unsupported or a 403 owner_only. A workspace looks up at most 200 senders a day, and the next one is a 429 research_limit_reached. A domain nothing could be found about is a 404.

پارامترها

emailstrالزامی

An address of the sender. Only its domain is looked up.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds this call may take, the response included, before it raises OpenEmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

خروجی

SenderProfileResource, what was found or what was already known.

نمونه

from openemail import openemail sender = openemail.senders.research('[email protected]') print(sender['domain'], sender['about'])

نکته‌ها

  • The SDK retries it after a network failure, which is safe because a domain that was found is answered from what was kept.

همچنین در دسترس در

API
POST /senders/{email}/research
TypeScript
senders.research()
Ruby
senders.research
CLI
openemail senders research