示例:
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: 任务详情,仅将用户的输入补全,并非实际执行结果,开发者可以忽略该字段
公共参数
domain_id 域名ID,多个 domain_id 用英文逗号进行分割
示例:
curl -X POST https://dnsapi.cn/Batch.Record.Create -d 'login_token=LOGIN_TOKEN&format=json&records=[{"sub_domain":"www,wap,bbs","record_type":"A","record_line":"默认","value":"11.22.33.44","ttl":600},{"sub_domain":"","record_type":"MX","record_line":"默认","value":"mx.qq.com","ttl":600,"MX":10}]&domain_id=25556994,25556952'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2015-09-08 17:38:09" }, "job_id": "49590", "detail": [ { "id": 0, "domain_id": "16", "domain": "wuhongsheng.com", "domain_grade": "DP_Free", "err_msg": null, "status": "waiting", "operation": null, "records": [ { "id": 0, "sub_domain": "www", "record_type": "A", "area": "默认", "value": "11.22.33.44", "mx": "5", "ttl": "600", "err_msg": null, "status": "waiting", "operation": "plus" }, { "id": 1, "sub_domain": "wap", "record_type": "A", "area": "默认", "value": "11.22.33.44", "mx": "5", "ttl": "600", "err_msg": null, "status": "waiting", "operation": "plus" }, { "id": 2, "sub_domain": "bbs", "record_type": "A", "area": "默认", "value": "11.22.33.44", "mx": "5", "ttl": "600", "err_msg": null, "status": "waiting", "operation": "plus" }, { "id": 3, "sub_domain": "", "record_type": "MX", "area": "默认", "value": "mx.qq.com", "mx": "5", "ttl": "600", "err_msg": null, "status": "waiting", "operation": "plus" } ] }, { "id": 1, "domain_id": "20", "domain": "dnspod.com", "domain_grade": "D_Ultra", "err_msg": null, "status": "waiting", "operation": null, "records": [ { "id": 0, "sub_domain": "www", "record_type": "A", "area": "默认", "value": "11.22.33.44", "mx": "5", "ttl": "600", "err_msg": null, "status": "waiting", "operation": "plus" }, { "id": 1, "sub_domain": "wap", "record_type": "A", "area": "默认", "value": "11.22.33.44", "mx": "5", "ttl": "600", "err_msg": null, "status": "waiting", "operation": "plus" }, { "id": 2, "sub_domain": "bbs", "record_type": "A", "area": "默认", "value": "11.22.33.44", "mx": "5", "ttl": "600", "err_msg": null, "status": "waiting", "operation": "plus" }, { "id": 3, "sub_domain": "", "record_type": "MX", "area": "默认", "value": "mx.qq.com", "mx": "5", "ttl": "600", "err_msg": null, "status": "waiting", "operation": "plus" } ] } ] }
- 字段说明:
- job_id: 任务ID,批量操作为异步执行,拿到 job_id 说明批量操作已经成功加入到任务队列,可通过 Batch.Detail 接口异步去查询执行结果
- detail: 任务详情,仅将用户的输入补全,并非实际执行结果,开发者可以忽略该字段
curl -X POST https://dnsapi.cn/Batch.Record.Modify -d ‘login_token=LOGIN_TOKEN&format=json&record_id=36,90,91&change=record_type&change_to=CNAME&value=dnsapi1.cn.’
curl -X POST https://dnsapi.cn/Batch.Record.Modify -d ‘login_token=LOGIN_TOKEN&format=json&record_id=36,90,91&change=status&change_to=disable’
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2015-09-08 18:21:13" }, "job_id": "409952", "detail": [ { "domain_id": 92, "domain": "dnsapi1.cn", "err_msg": null, "status": "waiting", "operation": null, "records": [ { "record_id": "36", "sub_domain": "bbs", "area": "默认", "record_type": "CNAME", "ttl": "600", "value": "bbs.dnsapi2.com.", "enabled": "1", "status": "waiting", "err_msg": null, "id": 0, "operation": "edit" } ], "domain_grade": "D_Plus", "id": 0 }, { "domain_id": 171, "domain": "dnsapi1.cn", "err_msg": null, "status": "waiting", "operation": null, "records": [ { "record_id": "90", "sub_domain": "www", "area": "电信", "record_type": "A", "ttl": "3600", "value": "11.11.22.22", "enabled": "1", "status": "waiting", "err_msg": null, "id": 0, "operation": "edit" }, { "record_id": "91", "sub_domain": "@", "area": "电信", "record_type": "MX", "ttl": "3600", "value": "61.144.40.92.", "enabled": "1", "status": "waiting", "mx": "5", "err_msg": null, "id": 1, "operation": "edit" } ], "domain_grade": "D_Free", "id": 1 } ] }
- 字段说明:
- job_id: 任务ID,批量操作为异步执行,拿到 job_id 说明批量操作已经成功加入到任务队列,可通过 Batch.Detail 接口异步去查询执行结果
- detail: 任务详情,仅将用户的输入补全,并非实际执行结果,开发者可以忽略该字段
示例:
curl -X POST https://dnsapi.cn/Batch.Detail -d 'login_token=LOGIN_TOKEN&format=json&job_id=409752'
返回参考:
JSON:
{ "status": { "code": "1", "message": "Action completed successful", "created_at": "2015-09-08 18:37:01" }, "detail": [ { "id": 0, "domain": "dnsapi1.cn", "domain_grade": "DP_Free", "err_msg": null, "status": "ok", "operation": "plus", "records": [ { "id": 0, "sub_domain": "www", "record_type": "A", "area": "默认", "value": "11.22.33.45", "ttl": 600, "err_msg": null, "status": "ok", "operation": "plus", "record_id": 118332371, "mx": null }, { "id": 1, "sub_domain": "@", "record_type": "A", "area": "默认", "value": "11.22.33.45", "ttl": 600, "err_msg": null, "status": "ok", "operation": "plus", "record_id": 118332372, "mx": null } ], "domain_id": "25562928" }, { "id": 1, "domain": "dnsapi2.cn", "domain_grade": "DP_Free", "err_msg": null, "status": "ok", "operation": "plus", "records": [ { "id": 0, "sub_domain": "www", "record_type": "A", "area": "默认", "value": "11.22.33.45", "ttl": 600, "err_msg": null, "status": "ok", "operation": "plus", "record_id": 118332377, "mx": null }, { "id": 1, "sub_domain": "@", "record_type": "A", "area": "默认", "value": "11.22.33.45", "ttl": 600, "err_msg": null, "status": "ok", "operation": "plus", "record_id": 118332378, "mx": null } ], "domain_id": "25562929" } ], "total": 6, "success": 6, "fail": 0, "type": "domain", "created_at": "2015-09-08 18:36:43" }
- 字段说明:
- detail.status 和 detail.records.status 对应 [‘error’,’ok’,’running’,’waiting’] 中的一种,分别代表出错、执行成功、正在执行中、等待执行,如果为 “error”,则在 err_msg 中会有错误信息
- total: 执行的总条数,单个域名、单个记录均计数为1
- success: 成功的条数
- fail: 失败的条数
- type: 对应 [‘domain’,’record_add’,’record_modify’] 中的一种,分别代表批量添加域名、批量添加记录、批量修改记录