Catalog PyPI
PACKAGE EXPLORERView in registry

ahs-cti-api-sdk

PyPI

Python SDK for the AHS CTI Platform

ahscontact-centerctitelephony
Versions collected1
Direct dependencies4From release 0.1.0a5
Last observed21 Oct, 09:44 UTC

README

Version 0.1.0a5 documentation

AHS CTI Python SDK

Python SDK for the AHS CTI Platform — initiate and control outbound calls via REST API.

Requirements: Python ≥ 3.9 · httpx ≥ 0.25


Installation

pip install ahs-cti-api-sdk

Quick Start

from ahs_cti import CtiClient

with CtiClient(base_url="https://cti.example.com", api_key="ctsk_...", tenant_id=1) as client:
    result = client.calls.dial("+919876543210")
    print(result.call_id)   # save this for end_call

    end = client.calls.end_call(
        result.call_id,
        disposition="INTERESTED",
        list_comments="Customer wants a demo next week",
    )
    print(end.duration)

Credential Authentication

from ahs_cti import CtiClient

with CtiClient(base_url="https://cti.example.com", user_id="agent1", password="secret") as client:
    result = client.calls.dial("+919876543210", caller_id="AH2007C")

Async Client

import asyncio
from ahs_cti import AsyncCtiClient

async def main():
    async with AsyncCtiClient(base_url="https://cti.example.com", api_key="ctsk_...") as client:
        result = await client.calls.dial("+919876543210")
        print(result.call_id)

asyncio.run(main())

ClientConfig Reference

For full control over transport settings, use ClientConfig:

from ahs_cti import CtiClient, ClientConfig

config = ClientConfig(
    base_url="https://cti.example.com",
    timeout=15.0,
    verify_ssl=False,   # for self-signed certificates
    max_retries=5,
)

with CtiClient(config=config, api_key="ctsk_...") as client:
    result = client.calls.dial("+919876543210")
ParameterTypeDefaultDescription
base_urlstrrequiredRoot URL of the CTI platform
timeoutfloat30.0Request timeout in seconds
verify_sslboolTrueSet False for self-signed certs
max_retriesint3Retry attempts on 5xx / network errors

Error Handling

from ahs_cti import CtiClient, CtiAuthError, CtiApiError, CtiRetryExhaustedError

with CtiClient(...) as client:
    try:
        result = client.calls.dial("+919876543210")
    except CtiAuthError:
        # Invalid or expired API key / credentials
        print("Authentication failed")
    except CtiRetryExhaustedError as e:
        # All retry attempts failed (5xx or network)
        print(f"Failed after {e.attempts} attempts: {e.last_exc}")
    except CtiApiError as e:
        # Any other API error (400, 404, 422 …)
        print(f"API error [{e.status_code}]: {e}")

Exception Hierarchy

CtiError
├── CtiAuthError          — 401 / login failure
└── CtiApiError           — 4xx / 5xx from the platform
    └── CtiRetryExhaustedError  — all retries exhausted

Retry Behaviour

The SDK automatically retries on 500, 502, 503, 504 responses and transient network errors (ConnectError, TimeoutException). Retries use exponential backoff:

AttemptDelay
1st (initial)none
2nd retry2 s
3rd retry4 s
4th retry8 s

Set max_retries=0 in ClientConfig to disable retries entirely.


Self-Signed Certificates

Internal / staging servers often use self-signed TLS certificates. Pass verify_ssl=False:

client = CtiClient(base_url="https://192.168.1.10:8082", api_key="ctsk_...", verify_ssl=False)

Do not disable SSL verification in production.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.0a522 May 20264

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:44 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:17fcf20c5fce0765d12e02357c9528ed6c90346562c0cdb78d5d471be3dc7ffb