DNSPod
旗下子品牌
API 文档
取消
文档目录
批量添加域名
注意:本页面提供 API 文档为 DNSPod 传统 API ,仅支持 DNSPod Token。仅限主账号调用,子账号不可用。 推荐使用 腾讯云 API 3.0 ,支持 CAM 权限管理,同时支持主账号、子账号调用。兼容腾讯云 API 密钥,提供 API Explorer、API 调用统计等工具,还可以与腾讯云其他产品更好协同使用。
1. 接口描述
本接口 Batch.Domain.Create 批量添加域名。
接口请求地址:https://dnsapi.cn/Batch.Domain.Create
HTTP请求方式:POST
2. 请求参数
以下请求参数列表仅列出了接口请求参数,正式调用时需要加上公共请求参数,见 公共请求参数 页面。
参数名 | 是否必须 | 类型 | 参数描述 |
---|---|---|---|
domains | 是 | String | 多个域名之间以英文的逗号分割。 |
record_value | 是 | String | 每个域名添加 @ 和 www 的 A 记录值,记录值为IP,如果不传此参数或者传空,将只添加域名,不添加记录。 |
3. 响应代码
以下请求参数列表仅列出了此接口请求响应代码,除此接口请求响应代码外。还包含 共通返回。
响应码 | 描述 |
---|---|
共通返回【具体错误信息参见 message 字段】 |
4. 示例
curl -X POST https://dnsapi.cn/Batch.Domain.Create -d 'login_token=LOGIN_TOKEN&format=json&domains=dnsapi1.cn,dnsapi2.cn,dnsapi3.cn,dnsapi4.cn&record_value=11.22.33.45'
返回示例如下:
- JSON:
{
"status": {
"code": "1",
"message": "Action completed successful",
"created_at": "2015-09-08 16:28:11"
},
"job_id": "39581",
"detail": [
{
"id": 0,
"domain": "dnsapi1.cn",
"domain_grade": "DP_Free",
"err_msg": null,
"status": "waiting",
"operation": "plus",
"records": [
{
"id": 0,
"sub_domain": "www",
"record_type": "A",
"area": "默认",
"value": "11.22.33.45",
"ttl": 600,
"err_msg": null,
"status": "waiting",
"operation": "plus"
},
{
"id": 1,
"sub_domain": "@",
"record_type": "A",
"area": "默认",
"value": "11.22.33.45",
"ttl": 600,
"err_msg": null,
"status": "waiting",
"operation": "plus"
}
]
},
{
"id": 1,
"domain": "dnsapi2.cn",
"domain_grade": "DP_Free",
"err_msg": null,
"status": "waiting",
"operation": "plus",
"records": [
{
"id": 0,
"sub_domain": "www",
"record_type": "A",
"area": "默认",
"value": "11.22.33.45",
"ttl": 600,
"err_msg": null,
"status": "waiting",
"operation": "plus"
},
{
"id": 1,
"sub_domain": "@",
"record_type": "A",
"area": "默认",
"value": "11.22.33.45",
"ttl": 600,
"err_msg": null,
"status": "waiting",
"operation": "plus"
}
]
}
]
}
- 字段说明:
- job_id: 任务ID,批量操作为异步执行,拿到 job_id 说明批量操作已经成功加入到任务队列,可通过 Batch.Detail 接口异步去查询执行结果。
- detail: 任务详情,仅将用户的输入补全,并非实际执行结果,开发者可以忽略该字段。
最近更新于 2022-01-24 11:43
DNSPod 域名检测工具
查询域名信息,快速排查网站问题
网站自助排障
快速判断问题、提供合适的解决方案