Skip to main content

SDK Python para integrar aplicaciones externas con UTILIA OS

Project description

UTILIA OS SDK para Python

SDK Python para integrar aplicaciones externas con el sistema de soporte de UTILIA OS.

Instalación

pip install utilia-sdk

Uso rápido

Asíncrono (recomendado)

from utilia_sdk import UtiliaSDK, CreateTicketInput, CreateTicketUser, IdentifyUserInput

async with UtiliaSDK(base_url="https://os.utilia.ai/api", api_key="tu-api-key") as sdk:
    # Identificar usuario
    user = await sdk.users.identify(
        IdentifyUserInput(external_id="user-123", email="user@example.com")
    )

    # Crear ticket
    ticket = await sdk.tickets.create(
        CreateTicketInput(
            user=CreateTicketUser(external_id="user-123"),
            title="Problema con facturación",
            description="No puedo ver mis facturas del mes pasado...",
        )
    )
    print(ticket.ticket_key)  # APP-0001

Síncrono

from utilia_sdk import UtiliaSDKSync, CreateTicketInput, CreateTicketUser

with UtiliaSDKSync(base_url="https://os.utilia.ai/api", api_key="tu-api-key") as sdk:
    ticket = sdk.tickets.create(
        CreateTicketInput(
            user=CreateTicketUser(external_id="user-123"),
            title="Problema con facturación",
            description="No puedo ver mis facturas del mes pasado...",
        )
    )

Servicios disponibles

  • sdk.tickets - Tickets de soporte (crear, listar, mensajes, cerrar, reabrir)
  • sdk.users - Usuarios externos (identificar, listar)
  • sdk.files - Archivos adjuntos (subir, obtener URL, quota)
  • sdk.ai - IA (sugerencias, transcripción)

Manejo de errores

from utilia_sdk import UtiliaSDKError, ErrorCode

try:
    ticket = await sdk.tickets.create(data)
except UtiliaSDKError as e:
    if e.is_unauthorized:
        print("API Key inválida")
    elif e.is_rate_limited:
        print("Demasiadas peticiones")
    elif e.is_retryable:
        print("Error temporal, reintentar")
    else:
        print(f"Error: {e.code} - {e.message}")

Licencia

MIT

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

utilia_sdk-0.3.0.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

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

utilia_sdk-0.3.0-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file utilia_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: utilia_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for utilia_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8ed51243a71683bb572827890343497b296c6cad2c99e7e9f09ae4fd45cb0bf6
MD5 2907ac75ea568332cad6d3b62143ce22
BLAKE2b-256 1cc6a714063b2f004d8ce9bc5ede0efb44c712b378b341899ac46b52cd59f521

See more details on using hashes here.

File details

Details for the file utilia_sdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: utilia_sdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for utilia_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c846ff8b3abb7063c8a93771f86ac5d4543a42f03f4d17afad681607d98614d9
MD5 8762933de2449ef3606b4c566e0c42ec
BLAKE2b-256 97774fdafc907859c68cf4c754715562e86f27301fa4c6914377f1cd0ebf6d19

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