获取批量写入任务明细
目的
用来获取之前执行的批量写入任务的详细信息。
请求 URL
https://www.zohoapis.com.cn/crm/bulk/v2/write/{job_id}
job_id - 批量写入任务的唯一ID。
请求方法
GET
范围
scope=ZohoCRM.bulk.CREATE
(或)
scope=ZohoCRM.bulk.ALL
响应结构
属性 | 数据类型 | 描述 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status | 字符串 | 指定批量写入任务的当前状态。例如:"status": "ADDED" 或 "IN PROGRESS" 或 "COMPLETED"。 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
character_encoding | 字符串 | 指定批量写入任务的字符编码。系统自动检测字符编码。但是,如果指定,它将优先使用指定的值。 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
resource 显示属性 | JSON 对象 | 包含有关所选模块、字段映射和用于此任务的文件ID的详细信息。 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
resource Properties
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id | 整型 | 指定批量写入任务的唯一标识符。 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
result | JSON 对象 | download_url:表示下载URL,您可以从该URL下载批量写入任务的结果(CSV文件)。 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
created_by | JSON 对象 | 指定发起批量读取任务的用户ID和名称。 示例 - "created_by": { "id": "1000000031045", "name": "Patricia Boyle" }, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
operation | 字符串 | 指定执行的批量写入操作的类型。示例:"operation": "insert"。 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
created_time | ISO8601 | 指定初始化批量写入任务的时间段。 |
备注:
要了解更多关于批量编写入API限制的信息, 点击这里。
示例请求
curl "https://www.zohoapis.com.cn/crm/bulk/v2/write/"111111000002308098"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
添加任务的示例响应
{
"status": "ADDED",
"resource": [
{
"status": "INPROGRESS",
"type": "data",
"module": "Deals",
"field_mappings": [
{
"api_name": "Deal_Name",
"index": 1,
"format": null,
"find_by": null,
"default_value": null
},
{
"api_name": "Stage",
"index": 132,
"format": null,
"find_by": null,
"default_value": null
}
],
"file": {
"status": "INPROGRESS"
}
}
],
"id": "111111000002308098",
"created_by": {
"id": "111111000000035795",
"name": "Patricia Boyle"
},
"operation": "insert",
"created_time": "2019-01-30T02:21:32-12:00"
}
进行中任务的示例响应
{
"status": "INPROGRESS",
"character_encoding": "UTF-8",
"resource": [
{
"status": "INPROGRESS",
"type": "data",
"module": "Deals",
"field_mappings": [
{
"api_name": "Deal_Name",
"index": 1,
"format": null,
"find_by": null,
"default_value": null
},
{
"api_name": "Stage",
"index": 2,
"format": null,
"find_by": null,
"default_value": null
}
],
"file": {
"status": "INPROGRESS",
"name": "Accounts.csv",
"added_count": 0,
"skipped_count": 100,
"updated_count": 0,
"total_count": 100
}
}
],
"id": "111111000002308051",
"created_by": {
"id": "111111000000035795",
"name": "Patricia Boyle"
},
"operation": "insert",
"created_time": "2019-01-30T02:18:15-12:00"
}
已完成任务的示例响应
{
"status": "COMPLETED",
"character_encoding": "UTF-8",
"resource": [
{
"status": "COMPLETED",
"type": "data",
"module": "Deals",
"field_mappings": [
{
"api_name": "Deal_Name",
"index": 1,
"format": null,
"find_by": null,
"default_value": null
},
{
"api_name": "Stage",
"index": 2,
"format": null,
"find_by": null,
"default_value": null
}
],
"file": {
"status": "COMPLETED",
"name": "Accounts.csv",
"added_count": 0,
"skipped_count": 100,
"updated_count": 0,
"total_count": 100
}
}
],
"id": "111111000002308051",
"result": {
"download_url": "/v2/crm/org6196138/bulk-write/111111000002308051/111111000002308051.zip"
},
"created_by": {
"id": "111111000000035795",
"name": "Patricia Boyle"
},
"operation": "insert",
"created_time": "2019-01-30T02:18:15-12:00"
}
已失败任务的示例响应
{
"status": "FAILED",
"resource": [
{
"status": "FAILED",
"message": "File index not found. Stage - 132",
"type": "data",
"module": "Deals",
"field_mappings": [
{
"api_name": "Deal_Name",
"index": 1,
"format": null,
"find_by": null,
"default_value": null
},
{
"api_name": "Stage",
"index": 132,
"format": null,
"find_by": null,
"default_value": null
}
],
"file": {
"status": "FAILED"
}
}
],
"id": "111111000002308098",
"created_by": {
"id": "111111000000035795",
"name": "Patricia Boyle"
},
"operation": "insert",
"created_time": "2019-01-30T02:21:32-12:00"
}