API Reference

io_beep_boop.api

This module defines the models used by the IO App API, and defines a client to interact with the API in a (kind of) Pythonic way.

io_beep_boop.api.client

class io_beep_boop.api.client.IOServiceClient(token: str, base_url: str = 'https://api.io.italia.it/api/v1', user_agent: Optional[str] = None)

Simplified wrapper for the IO App API.

Send a message to the user with the given fiscal_code on behalf of the service identified by the PEC given in legal_mail.

send_message(fiscal_code: str, content: io_beep_boop.api.models.MessageContent, time_to_live: int = 3600, default_addresses: Optional[io_beep_boop.api.models.DefaultAddresses] = None)

Send a message to the user with the given fiscal_code.

get_message(fiscal_code: str, message_id: str)

Get the message with the given message_id addressed to the user with the given fiscal_code.

get_profile(fiscal_code: str)

Get the profile of the user with the given fiscal_code.

get_subscriptions_on_day(date: datetime.date)

Get a list of hashed fiscal codes which subscribed and unsubscribed from the service on the given date.

Warning

Requires special authorization.

io_beep_boop.api.models

class io_beep_boop.api.models.Payee(*, fiscal_code: str)
fiscal_code: str
class io_beep_boop.api.models.PaymentData(*, amount: int, notice_number: str, invalid_after_due_date: bool, payee: io_beep_boop.api.models.Payee)
amount: int
notice_number: str
invalid_after_due_date: bool
payee: io_beep_boop.api.models.Payee
class io_beep_boop.api.models.PrescriptionData(*, nre: str, iup: str, prescriber_fiscal_code: str)
nre: str
iup: str
prescriber_fiscal_code: str
class io_beep_boop.api.models.LegalData(*, sender_email_from: str, has_attachment: bool, message_unique_id: str, original_message_url: str, pec_server_service_id: str)
sender_email_from: str
has_attachment: bool
message_unique_id: str
original_message_url: str
pec_server_service_id: str
class io_beep_boop.api.models.EuCovidCert(*, auth_code: str)
auth_code: str
class io_beep_boop.api.models.MessageContent(*, subject: str, markdown: str, payment_data: io_beep_boop.api.models.PaymentData = None, prescription_data: io_beep_boop.api.models.PrescriptionData = None, legal_data: io_beep_boop.api.models.LegalData = None, eu_covid_cert: io_beep_boop.api.models.EuCovidCert = None, due_date: datetime.datetime)
subject: str
markdown: str
payment_data: Optional[io_beep_boop.api.models.PaymentData]
prescription_data: Optional[io_beep_boop.api.models.PrescriptionData]
legal_data: Optional[io_beep_boop.api.models.LegalData]
eu_covid_cert: Optional[io_beep_boop.api.models.EuCovidCert]
due_date: datetime.datetime
class io_beep_boop.api.models.DefaultAddresses(*, email: str)
email: str
class io_beep_boop.api.models.SendMessageResponse(*, id: str)
id: str
class io_beep_boop.api.models.NotificationStatus(*, email: str)
email: str
class io_beep_boop.api.models.GetMessageResponse(*, message: io_beep_boop.api.models.MessageContent, notification: io_beep_boop.api.models.NotificationStatus)
message: io_beep_boop.api.models.MessageContent
notification: io_beep_boop.api.models.NotificationStatus
class io_beep_boop.api.models.UserProfile(*, sender_allowed: bool)
sender_allowed: bool
class io_beep_boop.api.models.SubscriptionsFeed(*, date_utc: datetime.date, subscriptions: list[str], unsubscriptions: list[str])
date_utc: datetime.date
subscriptions: list[str]
unsubscriptions: list[str]