Tinet CtiCloud OpenAPI CLI
Project description
CTICloud 命令行客户端,封装 OpenAPI 接口,与 CTICloud Wiki 中参数与响应一致,适合脚本化集成与 Agent 调用。
当前版本: 0.1.3
PyPI: https://pypi.org/project/tinet-cticloud-cli/
功能概览
| 子命令 | 说明 |
|---|---|
config |
本地凭证管理 |
agent |
座席管理与座席操作 |
agent-login |
座席服务端登录鉴权(区别于座席上线) |
agent-report |
座席报表查询 |
agent-status |
座席实时状态查询 |
agent-tel |
座席电话管理 |
area-code |
号码归属地查询 |
asr |
ASR 转写结果查询 |
cdr |
任务话单/来电/外呼/webcall/sip/预测外呼等通话记录查询 |
data-manager |
缓存数据管理 |
enterprise |
企业信息查询 |
enterprise-hotline |
企业号码列表查询 |
enterprise-setting |
企业配置管理 |
enterprise-voice |
企业语音文件管理 |
exten |
分机管理 |
hybrid-group |
号码池管理 |
investigation |
满意度调查记录查询 |
ivr-router |
呼入路由设置列表查询 |
monitor |
平台监控与实时统计:座席/队列/话机/业务/中继监控;座席/满意度/队列实时统计 |
rasr |
RASR 机器人对话事件查询 |
record |
录音试听/下载 |
skill |
技能与座席/队列关系查询 |
task |
外呼任务全生命周期管理;号码导入与查询;任务批次列表/详情;运行中任务监控总览与详情 |
webcall |
发起 webcall 呼叫 |
所有出站 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.3
tinet-cticloud-cli --help
指定版本或升级:
pip install 'tinet-cticloud-cli==0.1.3'
pip install --upgrade tinet-cticloud-cli
macOS 等受限环境可使用 pipx:
pipx install tinet-cticloud-cli
配置凭证
环境变量:
export CTICLOUD_REGION=your_enterprise_region
export CTICLOUD_VALIDATE_TYPE=2 # 1 部门编号验证 2 企业编号验证
export CTICLOUD_ENTERPRISE_ID=your_enterprise_id
export CTICLOUD_TOKEN=your_token
或配置文件:
# --validate-type:1 部门编号验证 2 企业编号验证
tinet-cticloud-cli config set \
--region your_enterprise_region \
--validate-type 2 \
--enterprise-id your_enterprise_id \
--token your_token
快速示例
顺序与上方「功能概览」一致:config 置顶,其余按字母序。
枚举含义与 --help 一致;完整取值见各子命令 --help 或 Wiki。
# 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 # 1 电话 2 分机 3 webrtc
tinet-cticloud-cli agent create --cno 9001 --name 张三 --area-code 010
tinet-cticloud-cli agent update --cno 9001 --comment 备注
tinet-cticloud-cli agent preview-outcall --cno 9001 --tel your_tel
tinet-cticloud-cli agent preview-outcall-cancel --cno 9001
# agent-login / agent-report / agent-status / agent-tel
tinet-cticloud-cli agent-login authenticate --cno 9001 --pwd your_password
# --time-range-type:1 日报表 2 周报表 3 月报表 4 自定义时间
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
# --call-type:1 呼入 2 webcall 4 预览外呼 5 预测外呼 6 主叫外呼 9 内部呼叫
tinet-cticloud-cli --json asr get --call-type 4 --main-unique-id sip-xxx
# cdr(--start-time / --end-time 等为 Unix 秒级时间戳)
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
# data-manager / enterprise*
tinet-cticloud-cli --json data-manager --method get --key your_key # set|get|delete
tinet-cticloud-cli --json enterprise get
tinet-cticloud-cli --json enterprise-hotline list-page --limit 10
tinet-cticloud-cli --json enterprise-setting list
tinet-cticloud-cli --json exten get --exten 8001
tinet-cticloud-cli --json hybrid-group list
tinet-cticloud-cli --json investigation query --limit 10
tinet-cticloud-cli --json ivr-router list
# monitor
tinet-cticloud-cli --json monitor agent --limit 10
tinet-cticloud-cli --json monitor enterprise-call-latest
# --queue-monitor-fields:queueParams,agentStatuses,queueEntries,agentSummary
tinet-cticloud-cli --json monitor queue --queue-monitor-fields queueParams --qnos 1000
tinet-cticloud-cli --json monitor statistics-queue
# rasr / record / skill / webcall
tinet-cticloud-cli --json rasr query --unique-id your-unique-id
tinet-cticloud-cli record get-info --record-file your-record-file.mp3
tinet-cticloud-cli --json record get-url --record-file your-record-file.mp3
tinet-cticloud-cli --json record get-batch-url --record-type record --record-file a.mp3,b.mp3
tinet-cticloud-cli --json skill list-relation --relation-type cno --name your-skill
tinet-cticloud-cli webcall --tel your_tel
# task
tinet-cticloud-cli task query --limit 10
tinet-cticloud-cli task monitor-tasks --status 2 # 1 运行中 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 data-manager --help
tinet-cticloud-cli enterprise --help
tinet-cticloud-cli enterprise-hotline --help
tinet-cticloud-cli enterprise-setting --help
tinet-cticloud-cli enterprise-voice --help
tinet-cticloud-cli exten --help
tinet-cticloud-cli hybrid-group --help
tinet-cticloud-cli investigation --help
tinet-cticloud-cli ivr-router --help
tinet-cticloud-cli monitor --help
tinet-cticloud-cli rasr --help
tinet-cticloud-cli record --help
tinet-cticloud-cli skill --help
tinet-cticloud-cli task --help
tinet-cticloud-cli webcall --help
OpenAPI 契约与字段说明见 CTICloud Wiki。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tinet_cticloud_cli-0.1.3.tar.gz.
File metadata
- Download URL: tinet_cticloud_cli-0.1.3.tar.gz
- Upload date:
- Size: 68.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5b63b98103c2f1b26ce90a4d9d82d1016edd341466cad0d9e8d98893151aacb
|
|
| MD5 |
f58e018fa5ddf401c42bc6401718262f
|
|
| BLAKE2b-256 |
dff1269fb1d8cad68cd84c16314ec53f0288d5f412fec48c5dd42f15e7f0b503
|
File details
Details for the file tinet_cticloud_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: tinet_cticloud_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 103.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e429343b61b64fb000d33486db09d09f6216434502bf9f0acac64dac110feb54
|
|
| MD5 |
6f3976ec37501010d26628f59e5e10b3
|
|
| BLAKE2b-256 |
18b34ece1d0acb5f026c2666640602dbe700e7120ed3cb28d2c07788556c9c00
|