Skip to main content

Tinet CtiCloud OpenAPI CLI

Project description

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

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

功能概览

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

所有出站 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.0.9
tinet-cticloud-cli --help

指定版本或升级:

pip install 'tinet-cticloud-cli==0.0.9'
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

快速示例

# 查询任务列表
tinet-cticloud-cli task query --limit 10

# 任务监控总览(运行中或暂停)
tinet-cticloud-cli task monitor-tasks --status 2

# 查询呼叫记录
tinet-cticloud-cli cdr list-auto-task --start-time 1700000000 --start-time-end 1700086400

# 平台监控与实时统计(--json 输出 Wiki 原始 JSON)
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

# 座席操作
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 备注
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

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

帮助与 API 文档

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

tinet-cticloud-cli --help
tinet-cticloud-cli task --help
tinet-cticloud-cli monitor --help
tinet-cticloud-cli agent --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 agent login --help
tinet-cticloud-cli cdr list-auto-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.0.9.tar.gz (71.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.0.9-py3-none-any.whl (104.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tinet_cticloud_cli-0.0.9.tar.gz
  • Upload date:
  • Size: 71.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.0.9.tar.gz
Algorithm Hash digest
SHA256 bb45e4b6158752f1872feb65a693516d338e1c3cf335afa1380593106f7fa125
MD5 a3ca07fd271b1eb73ec5ade69831a18c
BLAKE2b-256 2621ac2d77ce881a08ef9fa8762b14a2232e65ee75f66e423037c5317be3d960

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tinet_cticloud_cli-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 ce846c493da87f115b88a000787abe2e4b438a84d6520ca2e11806773e95dedf
MD5 495a5eb52143f64cd618b78f8e5eff0a
BLAKE2b-256 4b4d33382be603d7699694b1ade8c3675c2bb1d385d8db693cc681a5c596fc7c

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