Skip to main content

Tinet CtiCloud OpenAPI CLI

Project description

CTICloud 命令行客户端,封装 OpenAPI 接口,与 CTICloud Wiki 中参数与响应一致,适合脚本化集成与 Agent 调用。

当前版本: 0.1.0
PyPI: https://pypi.org/project/tinet-cticloud-cli/

功能概览

子命令 说明
config 本地凭证管理(~/.cticloud/config.json
agent 座席操作与数据管理:创建/更新、上线/下线/置忙/置闲/咨询/挂机/查询/删除等
agent-login 座席服务端登录鉴权(authenticate,非 agent login 上线)
agent-report 座席报表,如工作时长(agent-duration
agent-status 座席实时状态查询(get / batch-get,非 agent get 资料查询)
agent-tel 座席电话列表(tel-list
area-code 号码归属地:get / batch-get
asr ASR 转写结果查询:get
cdr 双通道话单:list-auto-task(CC 任务话单)+ ib-* / ob-* / webcall-query / sip-query / predictive-call-query / *-copy(interface v10 通话记录)
monitor 平台监控与实时统计:座席/队列/话机/业务/中继监控;座席/满意度/队列实时统计
record 根据录音文件名获取试听/下载 URL,可选 --output 落盘
task 预测/自动外呼任务全生命周期:创建、查询、更新、启动/暂停/结束、删除;号码导入与查询;任务批次列表/详情;运行中任务监控总览与详情

所有出站 HTTP 请求自动附加 X-CtiCloud-CLI-version: {版本号} 请求头(不参与 sign 计算)。

环境要求

  • Python ≥ 3.10
  • 运行时需访问 api-{region}.cticloud.cn
  • CTICloud 部门 token(环境变量或配置文件)

安装

PyPI 安装(推荐):

pip install tinet-cticloud-cli
tinet-cticloud-cli --version   # 0.1.0
tinet-cticloud-cli --help

指定版本或升级:

pip install 'tinet-cticloud-cli==0.1.0'
pip install --upgrade tinet-cticloud-cli

macOS 等受限环境可使用 pipx

pipx install tinet-cticloud-cli

配置凭证

环境变量:

export CTICLOUD_REGION=your_enterprise_region
export CTICLOUD_VALIDATE_TYPE=2
export CTICLOUD_ENTERPRISE_ID=your_enterprise_id
export CTICLOUD_TOKEN=your_token

或配置文件:

tinet-cticloud-cli config set \
  --region your_enterprise_region \
  --validate-type 2 \
  --enterprise-id your_enterprise_id \
  --token your_token

快速示例

顺序与上方「功能概览」一致:config 置顶,其余按字母序。

# config
tinet-cticloud-cli config show

# agent
tinet-cticloud-cli agent query --limit 10
tinet-cticloud-cli agent get --cno 2000
tinet-cticloud-cli agent login --cno 2000 --bind-tel 13800000001 --bind-type 1
tinet-cticloud-cli agent create --cno 9001 --name 张三 --area-code 010
tinet-cticloud-cli agent update --cno 9001 --comment 备注

# agent-login / agent-report / agent-status / agent-tel
tinet-cticloud-cli agent-login authenticate --cno 9001 --pwd your_password
tinet-cticloud-cli agent-report agent-duration --time-range-type 1 --start-time 2026-07-01 --end-time 2026-07-01
tinet-cticloud-cli agent-status get --cno 9001
tinet-cticloud-cli agent-tel tel-list --cno 9001

# area-code / asr
tinet-cticloud-cli --json area-code get --tel 13800138000
tinet-cticloud-cli --json asr get --call-type 4 --main-unique-id sip-xxx

# cdr
tinet-cticloud-cli cdr list-auto-task --start-time 1700000000 --start-time-end 1700086400
tinet-cticloud-cli --json cdr ib-query --start-time 1700000000 --end-time 1700086400

# monitor
tinet-cticloud-cli --json monitor agent --limit 10
tinet-cticloud-cli --json monitor enterprise-call-latest
tinet-cticloud-cli --json monitor queue --queue-monitor-fields queueParams --qnos 1000
tinet-cticloud-cli --json monitor statistics-queue

# record
tinet-cticloud-cli record get-info --record-file your-record-file.mp3

# task
tinet-cticloud-cli task query --limit 10
tinet-cticloud-cli task monitor-tasks --status 2

全局 --json 输出 Wiki 原始 JSON;默认人类可读摘要,并对手机号、password / encryptPassword 等敏感字段脱敏。

帮助与 API 文档

安装后通过 --help 查看各子命令及参数(与 Wiki Query/Body 字段一一对应):

tinet-cticloud-cli --help
tinet-cticloud-cli config --help
tinet-cticloud-cli agent --help
tinet-cticloud-cli agent login --help
tinet-cticloud-cli agent-login --help
tinet-cticloud-cli agent-report --help
tinet-cticloud-cli agent-status --help
tinet-cticloud-cli agent-tel --help
tinet-cticloud-cli area-code --help
tinet-cticloud-cli asr --help
tinet-cticloud-cli cdr --help
tinet-cticloud-cli cdr list-auto-task --help
tinet-cticloud-cli cdr ib-query --help
tinet-cticloud-cli monitor --help
tinet-cticloud-cli record --help
tinet-cticloud-cli task --help

OpenAPI 契约与字段说明见 CTICloud Wiki

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

tinet_cticloud_cli-0.1.0.tar.gz (84.6 kB view details)

Uploaded Source

Built Distribution

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

tinet_cticloud_cli-0.1.0-py3-none-any.whl (129.6 kB view details)

Uploaded Python 3

File details

Details for the file tinet_cticloud_cli-0.1.0.tar.gz.

File metadata

  • Download URL: tinet_cticloud_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 84.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for tinet_cticloud_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 320f1db773337124e9ad284f2bdd6e74ec1e1730089ab4b3db37baae42dafdc1
MD5 dca817f4c66d0cf3f60af9992189943c
BLAKE2b-256 9adc5f19447fd358f1ce9f43ea9ebccc427d13801d1f4c2c97746c859b0f9d03

See more details on using hashes here.

File details

Details for the file tinet_cticloud_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tinet_cticloud_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf55397124f6d5c001c752c9d9e3d7df1163f0b01d2b4adce7b996507128a4a0
MD5 f13a38b0368bd7c5ecbd2af969165908
BLAKE2b-256 05316dea5d353d2ed5d7286b27961fbed64de2f37c4671c62abfd4efd585fbe5

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