Skip to content

Repository files navigation

doslano

Публичный REST API doslano: отправка заказных писем одним запросом, проверка статуса и трек-номеров (наш РПО + Почты России), баланс, колбеки на финальный статус письма.

Авторизация — API-ключ в заголовке Authorization: Bearer dl_live_…. Ключи и журнал активности — в ЛК, раздел «API». Ключ имеет набор прав (scopes) и (опционально) IP-allowlist.

Оплата — только с баланса аккаунта (предоплата). Пополнение — в ЛК.

Колбеки — необязательный callback_url указывается при отправке каждого письма; иначе используйте поллинг GET /v1/letters/{id}. Тело колбека подписывается HMAC-SHA256 секретом аккаунта (заголовок X-Doslano-Signature).

Это дополнительный интерфейс доступа к тем же услугам; использование регулируется действующей офертой личного кабинета doslano.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Generator version: 7.10.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://doslano.ru

Requirements.

Python 3.8+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import doslano

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 doslano

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import doslano
from doslano.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://integration.doslano.ru
# See configuration.py for a list of all supported configuration parameters.
configuration = doslano.Configuration(
    host = "https://integration.doslano.ru"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (API key): apiKey
configuration = doslano.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


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

    try:
        # Баланс аккаунта
        api_response = api_instance.get_balance()
        print("The response of BalanceApi->get_balance:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling BalanceApi->get_balance: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://integration.doslano.ru

Class Method HTTP request Description
BalanceApi get_balance GET /v1/balance Баланс аккаунта
LettersApi create_letter POST /v1/letters Отправить письмо
LettersApi download_recipient_inventory_pdf GET /v1/letters/{id}/recipients/{recipient_id}/inventory.pdf PDF описи вложения получателя
LettersApi download_recipient_receipt_pdf GET /v1/letters/{id}/recipients/{recipient_id}/receipt.pdf PDF фискального чека получателя
LettersApi get_letter GET /v1/letters/{id} Статус письма
LettersApi get_recipient_tracking GET /v1/letters/{id}/recipients/{recipient_id}/tracking Трек-события получателя
LettersApi list_letters GET /v1/letters Список писем

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

apiKey

  • Type: Bearer authentication (API key)

Author

About

Python SDK для Integration API Дослано — отправка заказных писем Почтой России из вашего кода

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages