You need to enable JavaScript to run this app.
文档中心
语音服务

语音服务

复制全文
下载 pdf
语音
CreateTask - 创建任务
复制全文
下载 pdf
CreateTask - 创建任务

创建呼叫任务

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

CreateTask

要执行的操作,取值:CreateTask。

Version
String

2022-01-01

API的版本,取值:2022-01-01。

SmsConfig
Array of Object

[{"TemplateId":"xxxxx","Sign":"xxxxxx","StatusSet":[1,2,3]}]

挂机短信配置列表

ForbidTimeList
Array of Object

[{"Times":["10:00-11:00"],"Weekdays":[3]}]

禁呼时间设置

NumberList
Array of String

["13344445555","13255556666"]

选出用于拨打的主叫号码,SelectNumberType为1时必须传值

MaxRingDuration
Integer

20

最大响铃时长

RingAgainTimes
Integer

2

重呼次数,默认0,最大5次

PhoneList
Array of Object

[{"Phone":"12345678"}]

号码列表

Name
String

通知任务

任务名称

Resource
String

abcdef

话术资源id,比如语音文件id、tts模版id、IVR流程id

NumberPoolNo
String

NP123456

号码池编号

StartTime
String

2021-05-18 20:11:42

任务开始时间,格式为 yyyy-MM-dd HH:mm:ss

EndTime
String

2021-05-18 20:11:42

任务结束时间,格式为 yyyy-MM-dd HH:mm:ss

Start
Boolean

false

任务是否自动开始

RingAgainInterval
Integer

5

重呼间隔,最小5分钟,默认5,最长1440分钟

Concurrency
Integer

100

任务并发

FinishWhenListEnd
Boolean

false

是否列表拨打完任务就结束,默认false不结束

Unique
Boolean

false

是否开启号码去重,默认false不去重

SelectNumberType
Integer

0

号码池选号选择情况,0代表从整个号码池选号, 1代表从NumberList中选号,按照号码选号时需要设置,按照规则选号不设置该值

Type
Integer

0

任务类型(0录音文件, 1TTS模板,2IVR流程,3TTS)

SelectNumberRule
Integer

5

选号规则,目前仅支持传5(强烈推荐传该值),优先按照被叫号码归属地选号,如果没有选到降级到同省会,无同省会号码,默认降级到北京、上海、广州再选,如果还是没有选到,最后按照号码池随机选择一个号码

CallRecordPostUrl
String

https://abc.com

话单推送地址,后台话单回调开关打开时有效

AudioPostUrl
String

https://abc.com

录音推送地址

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
TaskOpenId
String

123

任务id

FailList
Array of Object

[{"Index":0,"Phone":"123456","Type":"REDUPLICATED_ITEM","Desc":"重复项目"}]

添加失败的号码

请求示例

POST /?Action=CreateTask&Version=2022-01-01 HTTP/1.1
Host: https://cloud-vms.volcengineapi.com
Content-Type: application/json; charset=UTF-8
X-Date: 20250527T114634Z
X-Content-Sha256: 287e874e******d653b44d21e
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20250527/cn-beijing/vms/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f

{
  "PhoneList": [
    {
      "Phone": "qOUFbQIX0Oo",
      "PhoneParamJson": "{\"key1\":\"value1\",\"key2\":\"value2\"}\n",
      "SmsParamJson": "{\"key1\":\"value1\",\"key2\":\"value2\"}\n",
      "TtsContent": "4YrHU",
      "Ext": "123456"
    }
  ],
  "SmsConfig": [
    {
      "TemplateId": "1234",
      "Sign": "【ABCD】",
      "StatusSet": [
        0
      ]
    }
  ],
  "ForbidTimeList": [
    {
      "Weekdays": [
        0
      ],
      "Times": [
        "[\"09:00-10:00\",\"15:00-16:00\"]"
      ]
    }
  ],
  "NumberList": [
    "[\"13344445555\",\"13255556666\"]"
  ],
  "Name": "通知任务",
  "Resource": "abcdef",
  "NumberPoolNo": "NP123456",
  "StartTime": "2021-05-18 20:11:42",
  "EndTime": "2021-05-18 20:11:42",
  "Start": true,
  "MaxRingDuration": "20",
  "RingAgainTimes": "0",
  "RingAgainInterval": 5,
  "Concurrency": 100,
  "FinishWhenListEnd": true,
  "Unique": true,
  "SelectNumberType": 0,
  "Type": 0,
  "SelectNumberRule": 5,
  "CallRecordPostUrl": "https://abc.com",
  "AudioPostUrl": "https://abc.com"
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "20250527194641159012061095F9F5B8",
    "Action": "CreateTask",
    "Version": "2022-01-01",
    "Service": "vms",
    "Region": "cn-beijing"
  },
  "Result": {
    "TaskOpenId": "123",
    "FailList": [
      {
        "Index": 167,
        "Type": "zSDuDyJ",
        "Phone": "XeuZ",
        "Desc": "重复项目"
      }
    ]
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
MissingParameter

The required parameter %s is missing.

400
InvalidParameter

The specified parameter %s is invalid.

400
OperationDenied

Operation is denied because the specified resource is in use.

400
QuotaExceeded

%s has exceeded the quota. example: The memory size of the specified disk has exceeded the quota.

400
IdempotentParameterMismatch

Parameters mismatch the previous request with a same ClientToken.

400
DryRunOperation

The request is validated by a dryrun operation.

500
InternalError

The request has failed due to an unknown error.

最近更新时间:2025.07.11 17:27:24
这个页面对您有帮助吗?
有用
有用
无用
无用