Skip to main content

Hostinger Mail API

Project description

Hostinger Mail API Python SDK

PyPI version

About

This is a Python SDK for the Hostinger API.

Requirements.

Python 3.9+

Installation & Usage

pip install

Setup new virtual environment (optional but recommended):

python3 -m venv venv
source venv/bin/activate

Install the package via pip:

pip install hostinger_mail_api

Then import the package:

import hostinger_mail_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import hostinger_mail_api

Getting Started

Please follow the installation procedure and then run the following:

import hostinger_mail_api
from hostinger_mail_api.rest import ApiException
from pprint import pprint


# Configure Bearer authorization: BearerAuth
configuration = hostinger_mail_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with hostinger_mail_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hostinger_mail_api.AccountApi(api_client)

    try:
        # Get the authenticated account
        api_response = api_instance.get_current_account()
        print("The response of AccountApi->get_current_account:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AccountApi->get_current_account: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.mail.hostinger.com

Class Method HTTP request Description
AccountApi get_current_account GET /api/v1/me Get the authenticated account
FoldersApi create_folder POST /api/v1/mailboxes/{mailboxResourceId}/folders Create folder
FoldersApi delete_folder DELETE /api/v1/mailboxes/{mailboxResourceId}/folders/{folder} Delete folder
FoldersApi list_folders GET /api/v1/mailboxes/{mailboxResourceId}/folders List folders
FoldersApi update_folder PUT /api/v1/mailboxes/{mailboxResourceId}/folders/{folder} Update folder
MessagesApi delete_all_messages DELETE /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages Delete all messages
MessagesApi delete_message DELETE /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} Delete message
MessagesApi delete_messages POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/delete Delete messages
MessagesApi get_message GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} Get message
MessagesApi get_message_attachment GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/attachments/{attachmentId} Download message attachment
MessagesApi get_message_source GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/source Get message source
MessagesApi get_message_text GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/text Get message text content
MessagesApi list_messages GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages List messages
MessagesApi move_message POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/move Move message
MessagesApi move_messages POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/move Move messages
MessagesApi patch_message PATCH /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} Update message flags
MessagesApi search_messages POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/search Search messages
MessagesApi update_message_flags POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/flags Update message flags
QuotaApi get_quota GET /api/v1/mailboxes/{mailboxResourceId}/quota Get mailbox quota
SendApi send_email POST /api/v1/mailboxes/{mailboxResourceId}/send Send email
WebhooksApi create_webhook POST /api/v1/mailboxes/{mailboxResourceId}/webhooks Create webhook
WebhooksApi delete_webhook DELETE /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook} Delete webhook
WebhooksApi get_webhook GET /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook} Get webhook
WebhooksApi list_webhooks GET /api/v1/mailboxes/{mailboxResourceId}/webhooks List webhooks
WebhooksApi regenerate_webhook_secret POST /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/regenerate-secret Regenerate webhook secret
WebhooksApi test_webhook POST /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/test Test webhook
WebhooksApi update_webhook PATCH /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook} Update webhook

Documentation For Models

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hostinger_mail_api-1.0.4.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hostinger_mail_api-1.0.4-py3-none-any.whl (101.1 kB view details)

Uploaded Python 3

File details

Details for the file hostinger_mail_api-1.0.4.tar.gz.

File metadata

  • Download URL: hostinger_mail_api-1.0.4.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hostinger_mail_api-1.0.4.tar.gz
Algorithm Hash digest
SHA256 db240bab441b28ec1950b29aa358f59a18c87874daba2d5e2501fccbb8e92b5d
MD5 5b6129536660c2d8a270900c7f2957ae
BLAKE2b-256 7ca76a502997c151a25e3a4af0a9011ef28d3f1302f260f5a145ce787d40d078

See more details on using hashes here.

File details

Details for the file hostinger_mail_api-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for hostinger_mail_api-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2b2b0ba077289b9fc1865e21c2145eb3fca3772ef8dd6611922804abe2852b20
MD5 5c6c6fe01a9a05a1a6cdc4c2937da76a
BLAKE2b-256 535b4181678fc51129ed014392c05eba2255dc0589a737e820e8ed9c00e42df3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page