首页 > API文档 > CRM
CRM基础接口V2
更新时间: 2022-12-15 02:04:55

CRM基础对象V2接口

目前支持回款、仓库、入库单、库存、发货单、信用等对象的数据接口。

1.新增对象数据

请求说明

请求路径:https://open.71360.com/cgi/crm/v2/data/create
请求方式:post+application/json 方式

参数说明
参数参数类型必须备注
corpAccessTokenString企业应用访问公司合法性凭证
corpIdString企业ID
currentOpenUserIdString当前操作人OpenUserID
dataMap对象数据map
data.object_dataMap对象数据map(和对象描述中字段一一对应)
data.detailsMap对象明细数据map(和对象描述中字段一一对应)


请求包结构体示例:

{     "corpAccessToken": "CORP_ACCESS_TOKEN",     "corpId": "CORP_ID",     "currentOpenUserId": "FSUID_XXXXXX",     "data": {       "object_data": {           "dataObjectApiName":"PaymentObj",         "record_type": "default__c",         "account_id": "2d58af2dbb4d4ecd931e80ef18xxxxxx",         "payment_amount": 1,         "payment_time": 1517328000000,         "payment_term": "post",         "notification_time": 1516982400000,         "owner": [           "FSUID_7B8A3925E40FA68630C0D7E9C3XXXXXX"         ],         "attachment": [],         "remark": "002测试"       },       "details": {         "OrderPaymentObj": [           {             "order_id": "974789b4d13040fcbb9d0ae35cxxxxxx",             "payment_amount": "1",             "attachment": [],             "remark": "1111",             "record_type": "default__c"           }         ]       }     } }

{     "corpAccessToken": "CORP_ACCESS_TOKEN",     "corpId": "CORP_ID",     "currentOpenUserId": "FSUID_XXXXXX",     "data": {         "object_data": {             "dataObjectApiName": "GoodsReceivedNoteObj",             "goods_received_date": 1520438400000,             "warehouse_id": "5ab9e468830bdbc390daebb7",             "goods_received_type": "1",             "remark": "openapi测试add",             "owner": [                 "FSUID_XXXXXX"             ]     },     "details": {         "GoodsReceivedNoteProductObj": [             {                 "product_id": "a86b57c8065140d1ae2922679603ebe5",                 "unit": "只",                 "goods_received_amount": "10009",                 "object_describe_api_name": "GoodsReceivedNoteProductObj"             },             {                 "product_id": "c8658c7ac31a4686904bb38752640281",                 "goods_received_amount": "856325",                 "remark": "OpenApi test",                 "object_describe_api_name": "GoodsReceivedNoteProductObj"             }         ]     }   } }

返回说明

a)正确的Json返回结果示例:

{     "dataId": "5a9ce894f125ae9befxxxxxx",     "errorCode": 0,     "errorMessage": "OK",     "errorDescription": "success" }

b)错误的Json返回示例:

{     "errorCode": 320002500,     "errorMessage": "客户名称关联关系不存在" }

2.更新对象数据

请求说明

请求路径:https://open.71360.com/cgi/crm/v2/data/update
请求方式:post+application/json 方式

参数说明
参数参数类型必须备注
corpAccessTokenString企业应用访问公司合法性凭证
corpIdString企业ID
currentOpenUserIdString当前操作人OpenUserID
dataMap对象数据map
data.object_dataMap对象数据map(和对象描述中字段一一对应)
data.detailsMap对象明细数据map(和对象描述中字段一一对应)


请求包结构体示例:

{     "corpAccessToken": "CORP_ACCESS_TOKEN",     "corpId": "CORP_ID",     "currentOpenUserId": "FSUID_XXXXXX",     "data":{         "object_data":{             "dataObjectApiName":"PaymentObj",             "remark":"测试更新003",             "_id":"5a9ce894f125ae9befxxxxxx",             "record_type":"default__c",             "object_describe_id":"5a61892fab18973f90xxxxxx",             "account_id":"2d58af2dbb4d4ecd931e80ef18xxxxxx",             "payment_time":1517328000000,             "payment_term":"2",             "notification_time":1517241600000,             "attachment":[             ],             "version":"2"         },         "details":{             "OrderPaymentObj":[                 {                     "version":"1",                     "_id":"5a65ca1396a74c1a3bxxxxxx",                     "order_id":"974789b4d13040fcbb9d0ae35cxxxxxx",                     "payment_amount":"200.00",                     "object_describe_api_name":"OrderPaymentObj",                     "record_type":"default__c"                 },                 {                     "version":"1",                     "_id":"5a65ca1396a74c1a3bxxxxxx",                     "order_id":"974789b4d13040fcbb9d0ae35cxxxxxx",                     "payment_amount":"100.00",                     "object_describe_api_name":"OrderPaymentObj",                     "record_type":"default__c"                 }             ]         }     } }

{     "corpAccessToken": "CORP_ACCESS_TOKEN",     "corpId": "CORP_ID",     "currentOpenUserId": "FSUID_XXXXXX",     "data": {     "object_data": {         "dataObjectApiName": "GoodsReceivedNoteObj",         "_id": "5ac1e101830bdb5f9feb192f",         "remark": "openapi测试update2",         "owner": [             "FSUID_XXXXXX"         ]     },     "details": {          "GoodsReceivedNoteProductObj": [             {                 "_id": "5ac1e102830bdb5f9feb1934"             }         ]     }   } }

返回说明
参数必须说明
errorCode返回码
errorMessage对返回码的文本描述内容


a)正确的Json返回结果示例:

{     "errorCode": 0,     "errorMessage": "success" }

b)错误的Json返回示例:

{     "errorCode": 20016,     "errorMessage": "corpAccessToken error" }

3.查询对象数据

请求说明

请求路径:https://open.71360.com/cgi/crm/v2/data/query
请求方式:post+application/json 方式

参数说明
参数参数类型必须备注
corpAccessTokenString企业应用访问公司合法性凭证
corpIdString企业ID
currentOpenUserIdString当前操作人OpenUserID
data二级对象查询条件
data.dataObjectApiNameString对象的api_name
data.search_query_info三级对象查询条件列表
data.search_query_info.limitint获取数据条数,默认20,最大值为1000(自定义对象最大值为100)
data.search_query_info.offsetint偏移量,从0开始、数值必须为limit的整数倍
data.search_query_info.filtersList过滤条件列表
data.search_query_info.filters.field_nameString字段名
data.search_query_info.filters.field_valuesList取值范围
data.search_query_info.filters.operatorString支持操作
data.search_query_info.ordersList排序
data.search_query_info.orders.fieldNameString字段名
data.search_query_info.orders.isAscboolean如果是ture,按照升序排列,如果是false,则按照倒序排列
data.search_query_info.fieldProjection
List返回字段列表


operator参数说明
参数参数含义参数参数含义
EQ=GT>
LTGTE>=
LTEN
LIKELIKENLIKENOT LIKE
ISISISNIS NOT
ININNINNOT IN
BETWEENBETWEENNBETWEENNOT BETWEEN
STARTWITHLIKE%ENDWITH%LIKE
NEXISTSNOT EXISTSEXISTSEXISTS
CONTAINSArray 包含


请求包结构体示例:

{     "corpAccessToken": "CORP_ACCESS_TOKEN",     "corpId": "CORP_ID",     "currentOpenUserId": "FSUID_XXXXXX",     "data": {         "dataObjectApiName": "PaymentObj",         "search_query_info": {             "limit": 5,             "offset": 0,             "filters": [                 {                     "field_name": "owner",                     "field_values": [                         "FSUID_7B8A3925E40FA68630C0D7E9C3XXXXXX"                     ],                     "operator": "IN"                 }             ],             "orders": [                 {                     "fieldName": "payment_amount",                     "isAsc": false                 }             ],             "fieldProjection": ["_id","name"]         }     } }

返回说明
参数必须说明
data查询结果
data.total总记录数
data.offset获取数据条数,默认20,最大值为1000(自定义对象最大值为100)
data.limit偏移量,从0开始、数值必须为limit的整数倍
data.dataList数据列表
errorCode返回码
errorMessage对返回码的文本描述内容
errorDescription对返回码的文本描述内容


a)正确的Json返回结果示例:


{     "data": {         "total": 4,         "offset": 0,         "dataList": [             {                 "payment_time": 1517328000000,                 "remark": "测试更新02",                 "account_id__r": "测试",                 "is_deleted": false,                 "attachment": [],                 "order_data_id": "974789b4d13040fcbb9d0ae35cxxxxxx",                 "total_num": 4,                 "owner_department": "董事会",                 "owner": [                    "FSUID_0253C6D7FC0E3A2CBB19F336CEXXXXXX"                 ],                 "lock_status": "0",                 "last_modified_time": 1519986766107,                 "create_time": 1519985373616,                 "payment_term": "2",                 "life_status": "normal",                 "payment_amount": "300.00",                 "last_modified_by": [                    "FSUID_0253C6D7FC0E3A2CBB19F336CEXXXXXX"                  ],                 "created_by": [                    "FSUID_7B8A3925E40FA68630C0D7E9C3XXXXXX"                 ],                 "record_type": "default__c",                 "notification_time": 1517241600000,                 "account_id": "2d58af2dbb4d4ecd931e80ef18xxxxxx",                 "name": "20180302-000004",                 "_id": "5a9922dd742c2ff572xxxxxx",                 "order_id": "20180302-000002"             },             {                 "payment_time": 1521561600000,                 "account_id__r": "测试",                 "is_deleted": true,                 "attachment": [],                 "order_data_id": "974789b4d13040fcbb9d0ae35cxxxxxx,cff4ca67f38c49639df64f50d3xxxxxx",                 "total_num": 4,                 "owner_department": "董事会",                 "owner": [                    "FSUID_7B8A3925E40FA68630C0D7E9C3XXXXXX"                 ],                 "lock_status": "0",                 "last_modified_time": 1519984004508,                 "create_time": 1519978401106,                 "life_status": "invalid",                 "payment_amount": "20.00",                 "last_modified_by": [                    "FSUID_0253C6D7FC0E3A2CBB19F336CEXXXXXX"                 ],                 "created_by": [                    "FSUID_7B8A3925E40FA68630C0D7E9C3XXXXXX"                 ],                 "record_type": "default__c",                 "account_id": "2d58af2dbb4d4ecd931e80ef18xxxxxx",                 "name": "20180302-000002",                 "_id": "5a9907a1f125ae0a1axxxxxx",                 "order_id": "20180302-000002,20180302-000001"             }         ],         "limit": 5     },     "errorCode": 0,     "errorMessage": "OK",     "errorDescription": "success" }

b)错误的Json返回示例:

{     "errorCode": 10006,     "errorMessage": "the parameter corpAccessToken is missing or illegal",     "errorDescription": "缺少参数 或参数 不合法" }

4.根据Id获取对象数据

请求说明

请求路径:https://open.71360.com/cgi/crm/v2/data/get
请求方式:post+application/json 方式

参数说明
参数参数类型必须备注
corpAccessTokenString企业应用访问公司合法性凭证


留言、咨询与反馈
我们会在1个工作日内和您联系(工作时间 周一至周五 9:00-18:00)
留言、咨询与反馈
请填写联系方式

网站提交留言-隐私协议

感谢您浏览本网站相关信息!

1、本协议是用户(“您”)与本网站所订立的契约,为方便您深入了解业务及提交需求等,本网站将为您提供更加个性化的留言表单服务,您在提交留言表单时,我们可能会收集和使用您的相关信息。我们非常重视用户信息的保护,我们将按照法律法规要求,采取相应的安全保护措施。

2、除非您已充分阅读、理解并同意接受和遵守本协议,否则,请勿提交留言表单。 您如果继续提交即表示接受本协议,本协议即在您与本网站之间产生法律效应。