> 前置依赖:运行脚本前需安装 CLI — npm install tencentads-cli@1.0.0(需要 Node.js ≥ 20)
> - 脚本调用: 所有 API 操作通过本 Skill 目录下的脚本执行,格式为 node scripts/<脚本名>.mjs '。
> - 认证依赖: 本技能依赖 tencentads-auth 技能配置的 API Key 凭据,如遇认证错误请先完成鉴权。
> 脚本调用格式统一:node scripts/<脚本名>.mjs '
> 执行脚本时先进入本 skill 根目录,再按相对 scripts/ 路径调用。
脚本调用格式为 node scripts/<脚本名>.mjs ',但 JSON 参数的引号包裹方式因操作系统/终端而异,传递不当会导致 JSON.parse 报错(如 Expected property name or '}' in JSON at position 1)。
| 终端环境 | 正确写法 | 说明 |
|---|---|---|
| --------- | --------- | ------ |
| Linux / macOS (Bash/Zsh) | node scripts/xxx.mjs '{"key":"value"}' | ✅ 单引号包裹,内部双引号原样保留 |
| Windows Git Bash | node scripts/xxx.mjs '{"key":"value"}' | ✅ 同 Bash |
| Windows CMD | node scripts/xxx.mjs "{\"key\":\"value\"}" | ✅ 双引号包裹 + 反斜杠转义 |
| Windows CMD (备选) | node scripts/xxx.mjs "{""key"":""value""}" | ✅ 双引号包裹 + 双双引号转义 |
| Windows PowerShell 5.x | node --% scripts/xxx.mjs "{\"key\":\"value\"}" | ✅ 必须加 --% 停止解析符 |
| Windows PowerShell 5.x (备选) | ` node scripts/xxx.mjs "{\"key\":\"value\"}" ` | ✅ 反斜杠 + 反引号组合转义 |
> ⛔ PowerShell 5.x 是重灾区:单引号 '...'、反引号 ` " ` 、反斜杠 \" 三种常见写法全部失败(双引号会被吞掉)。必须使用 --% 停止解析符或 \" `` 组合转义。
> ⛔ Windows CMD 不支持单引号包裹字符串,单引号会被当作普通字符传入脚本,导致 JSON 解析失败。
| 脚本 | 功能 | 必填参数 | 可选参数 |
|---|---|---|---|
| ------ | ------ | --------- | --------- |
scripts/get-account-list.mjs | 查询当前用户关联的竞价广告主账号列表 | - | corporation_name_fuzzy_list, page, page_size |
scripts/get-daily-budget.mjs | 查询账户日预算 | account_id | - |
scripts/update-daily-budget.mjs | 修改账户日预算 | account_id, daily_budget | use_min_daily_budget |
scripts/get-funds.mjs | 查询资金账户信息(余额/锁定金额/今日消耗) | account_id | fund_type_list |
scripts/get-wallet.mjs | 查询共享钱包信息(余额/绑定账户等) | account_id | - |
调用 user_account_list/get 接口,获取当前 user_id 下关联的竞价广告主账户信息列表。
> ⚠️ 仅返回竞价广告主账户,不包含代理商等其他类型账户。
# 查询全部关联账号(默认分页)
node scripts/get-account-list.mjs
# 按公司名称模糊搜索(最多 2 个关键词,每个 2~50 字符)
node scripts/get-account-list.mjs '{"corporation_name_fuzzy_list":["广州","西安"]}'
# 指定分页参数(page_size 范围 1~500)
node scripts/get-account-list.mjs '{"page":2,"page_size":20}'
> 分页上限限制:严格要求 page * page_size <= 13000,超出此限制接口将报错。
接口详情见: references/user-account-list-get.md
get-account-list.mjs,传入 corporation_name_fuzzy_listget-account-list.mjs(不传参数或仅传分页参数)get-account-list.mjs 仅返回竞价广告主账户,不包含其他类型page 默认为 1,不传 page_size 默认为 10corporation_name_fuzzy_list 最多传 2 个字符串,每个字符串长度限制 2~50 个字符tencentads-auth 技能配置的 API Key 凭据,如遇认证错误请先完成鉴权get-account-list.mjs 严格要求 page * page_size <= 13000,超出此限制接口将报错tencentads-auth 技能重新配置 API Keycorporation_name_fuzzy_list 参数不合法(超过 2 个、字符串长度不在 2~50 范围),脚本会返回明确的错误提示| 功能 | 文档 | 说明 |
|---|---|---|
| ------ | ------ | ------ |
| 广告主账号列表查询 | user-account-list-get.md | 查询当前用户关联的竞价广告主账号列表 |
| 账户日预算查询与修改 | advertiser-daily-budget.md | 查询当前日预算、修改日预算,含 Agent 使用流程和 use_min_daily_budget 决策规则 |
| 资金账户信息查询 | funds-get.md | 查询各类资金账户余额、锁定金额、今日消耗,支持按 fund_type 过滤 |
| 钱包信息查询 | wallet-get.md | 查询共享钱包余额、名称、代理商、主体及绑定账户信息 |
共 3 个版本