Published at: 2025-10-30

API Development


The purpose of this interface documentation is to clearly describe the currently supported interface methods of the ERP data synchronization platform (including three synchronization methods: actively invoking heterogeneous systems to create/modify interface push information, polling heterogeneous systems for incremental data by time period, and providing passive reception of push information from heterogeneous systems). This documentation is intended for developers to use as a basis for integration development, to avoid communication discrepancies between parties.

1. Integration Platform Interface Viewing/Generation Method

Interface Viewing Method: Log in to ShareCRM, navigate to Management > System Management > System Integration Management > ERP Data Synchronization > Data Synchronization Settings. After entering, under the ERP Object Management tab, create a new intermediate table object, configure the fields of the ERP-side object, and return. Click the Generate API button in the operation column on the right side of the object to view the interface format corresponding to the object.
image

2. Integration Platform Push

The ERP data synchronization platform listens to ShareCRM’s MQ messages. When an Account creates/modifies business documents in ShareCRM, ShareCRM will generate MQ messages in real-time to notify the integration platform. After receiving the message, the platform actively pushes the business document data to the heterogeneous system. For interface viewing methods, refer to the ERP Data Synchronization Platform Interface Viewing/Generation Method section.

2.1 Create Interface

Interface Path: http://MyDoman/path/create — Please replace http://MyDoman/path/ and the address part in curl with the actual ERP access path filled in the ERP vendor settings tab.
Request Method: POST
Data Format: Supports multiple data formats such as xml, text, json, etc. It is recommended to use json format.
Request Format: Refer to the following example:
shell curl --location --request POST 'http://MyDoman/path/create' \ --header 'Content-Type: application/json' \ --header 'token: TOKEN' \ --data-raw '{ "objAPIName": "APIName of ERP-side object", "masterFieldVal": { "Key1": "value1", "Key2": "value2", "Key3": "value3" }, "detailFieldVals": { "Detail apiName1": [ { "Key4": "value4", "Key5": "value5", "Key6": "value6" } ], "Detail apiName2": [ { "Key4": "value7", "Key5": "value8", "Key6": "value9" } ] } }'
Response Example:
json { "code": "Error return code", "message": "Error message", "data": { "masterDataId": "dataid", "detailDataIds": { "Key10": "value10", "Key11": "value11", "Key12": "value12" } } }

2.2 Update Interface

Interface Path: http://MyDoman/path/update — Please replace http://MyDoman/path/ and the address part in curl with the actual ERP access path filled in the ERP vendor settings tab.
Request Method: POST
Data Format: Supports multiple data formats such as xml, text, json, etc. It is recommended to use json format.
Request Format: Refer to the following example:
shell curl --location --request POST 'http://MyDoman/path/update' \ --header 'Content-Type: application/json' \ --header 'token: TOKEN' \ --data-raw '{ "objAPIName": "APIName of ERP-side object", "masterFieldVal": { "Key1": "value1", "Key2": "value2", "Key3": "value3" }, "detailFieldVals": { "Detail apiName1": [ { "Key4": "value4", "Key5": "value5", "Key6": "value6" } ], "Detail apiName2": [ { "Key4": "value7", "Key5": "value8", "Key6": "value9" } ] } }'
Response Example:
json { "code": "Error return code", "message": "Error message", "data": { "masterDataId": "dataid", "detailDataIds": { "Key10": "value10", "Key11": "value11", "Key12": "value12" } } }

3. Integration Platform Polling

The ERP data synchronization platform actively queries the need for heterogeneous systems to provide batch and single query interfaces. Polling refers to the ERP data synchronization platform using the GET request method to periodically poll the batch query interface of the heterogeneous system to query incremental data within the time period. The minimum interval can be set to 6 minutes on the interface. For interface viewing methods, refer to the ERP Data Synchronization Platform Interface Viewing/Generation Method section.

3.1 Batch Query Request

Interface Path: http://MyDoman/path/queryMasterBatch?objAPIName=Query ERP object’s APIName&startTime=Start time of data change (unix timestamp, Unit milliseconds)&endTime=End time of data change (unix timestamp, Unit milliseconds)&includeDetail=true&offset=Record offset&limit=Number of records in the current request — Please replace http://MyDoman/path/ and the address part in curl with the actual ERP access path filled in the ERP vendor settings tab.
Request Method: GET
Return Data Format: Supports multiple data formats such as xml, text, json, etc. It is recommended to use json format.
Request Format:
GET http://MyDoman/path/queryMasterBatch?objAPIName=Query ERP object’s APIName&startTime=Start time of data change (unix timestamp, Unit milliseconds)&endTime=End time of data change (unix timestamp, Unit milliseconds)&includeDetail=true&offset=Record offset&limit=Number of records in the current request
Response Example:
json { "code": "Error return code", "message": "Error message", "data": { "totalNum": "Total number of records", "dataList": [ { "objAPIName": "APIName of ERP-side object", "masterFieldVal": { "Key1": "value1", "Key2": "value2", "Key3": "value3" }, "detailFieldVals": { "Detail apiName1": [ { "Key4": "value4", "Key5": "value5", "Key6": "value6" } ], "Detail apiName2": [ { "Key4": "value7", "Key5": "value8", "Key6": "value9" } ] } } ] } }

3.2 Single Query Request

Interface Path: http://MyDoman/path/queryMasterById?objAPIName=Query ERP-side object’s APIName&dataId=Data id&includeDetail=true — Please replace http://MyDoman/path/ and the address part in curl with the actual ERP access path filled in the ERP vendor settings tab.
Request Method: GET
Return Data Format: Supports multiple data formats such as xml, text, json, etc. It is recommended to use json format.
Request Format:
GET http://MyDoman/path/queryMasterById?objAPIName=Query ERP-side object’s APIName&dataId=Data id&includeDetail=true
Response Example:
json { "code": "Error return code", "message": "Error message", "data": { "objAPIName": "APIName of ERP-side object", "masterFieldVal": { "Key10": "value10", "Key11": "value11", "Key12": "value12" }, "detailFieldVals": { "Detail apiName1": [ { "Key13": "value13", "Key14": "value14", "Key15": "value15" } ], "Detail apiName2": [ { "Key13": "value16", "Key14": "value17", "Key15": "value18" } ] } } }

4. Integration Platform Reception

After the heterogeneous system creates/modifies business documents, it pushes data to the ERP data synchronization platform in two different formats (standard format/non-standard format). In the passive reception mode of the ERP data synchronization platform, the Header parameter content of the data pushed by the heterogeneous system must follow one of the two formats: standard format/non-standard format. If the heterogeneous system uses the active push method, it is recommended to use the standard format to push data. For interface viewing methods, refer to the ERP Data Synchronization Platform Interface Viewing/Generation Method section.
Push Execution Logic: The external interface actively calls the integration platform’s push interface to push data into the integration platform’s cache. The platform will asynchronously pull data from the cache table. If writing to the cache table fails, it directly returns an error message. If pulling data from the cache fails, you need to check the data error reason in the integration platform’s data maintenance.
Note: The standard format and non-standard format are distinguished based on the format of the data pushed by the heterogeneous system. Under both formats, there are requirements for the Header parameters of the push information (the standard format requires the header to provide the data id), but the non-standard format has no requirements for the body part of the push information, while the body part of the standard format must also be provided according to the platform’s required format. See the following explanation for details:

4.1 Standard Format Push Data Interface Description

Request Method: POST
Data Format: Only supports json data format.
Request Header Parameters: (Parameters can be obtained by clicking the Generate API button on any object in the ERP object list, and entering the push interface description to view the relevant parameters)
Field Description
token Request authentication string [Please contact ShareCRM R&D for provision]
tenantId CRM’s enterprise ID
dataCenterId Not required for single account set, must be pushed and filled for multiple account sets
objectApiName Real object name on ERP side, can be found in Data Synchronization Settings -> ERP Object Settings -> ERP Object Code
version v1
operationType 3 for cancellation, other statuses do not require this field to be pushed
id [lowercase id] Indicates whether it is transmitted in standard format. If id value is non-empty, it follows standard format logic. If empty, it follows the push interface’s custom function adaptation logic. Note: If the id value is non-empty and the input data format is inconsistent with the platform’s standard format, it will cause message parsing exceptions.
image
image
Standard Format:
Request Format:
json { "objAPIName": "APIName of ERP-side object", "masterFieldVal": { "Key1": "value1", "Key2": "value2", "Key3": "value3" }, "detailFieldVals": { "Detail apiName1": [ { "Key4": "value4", "Key5": "value5", "Key6": "value6" } ], "Detail apiName2": [ { "Key4": "value7", "Key5": "value8", "Key6": "value9" } ] } }
Response Example (Note: Successful errCode is s106240000, others are failures):
json { "errCode": "s106240000", "errMsg": "Success" }

4.2 Non-Standard Format Push Data Interface Description

Data Format: Supports multiple data formats such as xml, text, json, etc. It is recommended to use json format.
Request Header Parameters:
Field Description
token Request authentication string [Please contact ShareCRM R&D for provision]
tenantId CRM’s enterprise ID
dataCenterId Not required for single account set, must be pushed and filled for multiple account sets
objectApiName Real object name on ERP side, can be found in Data Synchronization Settings -> ERP Object Settings -> ERP Object Code
version v1
operationType 3 for cancellation, other statuses do not require this field to be pushed
Request Format: No restrictions
Response Example (Note: Successful errCode is s106240000, others are failures):
json { "errCode": "s106240000", "errMsg": "Success" }

5. Data Intermediate Table Open Interface Capability

Custom functions can insert/modify/query data mapping tables. Example functions are as follows:
```groovy Map header = [:] // Create data mapping Map param1 = [ “ployDetailId”: “155bd981457343f291e0edc13776217f”, // Strategy detail id, if the strategy is deleted and rebuilt, this needs to be changed “sourceObjectApiName”: “AccountObj”, // Source object apiName, if the object apiName changes, this needs to be changed “destObjectApiName”: “BD_Customer.BillHead”, // Target object apiName (virtual), if the object apiName changes, this needs to be changed “sourceDataId”: “sourceDataId123”, // Source object data id “destDataId”: “destDataId123666”, // Target object data id “sourceDataName”: “sourceDataName3666”, // Source object data name attribute “destDataName”: “destDataName66”, // Target object data name attribute “remark”: “remark1341” // Remark ] def result1 = Fx.proxy.callAPI(“erp.syncData.createSyncDataMapping”, header, param1); // [false, HttpResult(statusCode=200, content={“errCode”:”s106240000”,”errMsg”:”Success”}, bytes=null), ] s106240000 success, others fail log.info(result1)
// Update target object data id based on source object data id Map param2 = [ “sourceObjectApiName”: “AccountObj”, // Source object apiName, if the object apiName changes, this needs to be changed “destObjectApiName”: “BD_Customer.BillHead”, // Target object apiName (virtual), if the object apiName changes, this needs to be changed “sourceDataId”: “sourceDataId123”, // Source object data id “destDataId”: “destDataId123666” // Target object data id ] def result2 = Fx.proxy.callAPI(“erp.syncData.updateSyncDataMapping”, header, param2); // [false, HttpResult(statusCode=200, content={“errCode”:”s106240000”,”errMsg”:”Success”}, bytes=null), ] s106240000 success, others fail log.info(result2)
// Query whether the source object data id has a mapping relationship Map param3 = [ “sourceObjectApiName”: “AccountObj”, // Source object apiName, if the object apiName changes, this needs to be changed “destObjectApiName”: “BD_Customer.BillHead”, // Target object apiName (virtual), if the object apiName changes, this needs to be changed “sourceDataId”: [“sourceDataId123”] // Source object data ids, List ] // If you need to query whether the target object data id has a mapping relationship, change sourceDataId to destDataId. If both are passed, it will only query based on the source data id def result3 = Fx.proxy.callAPI(“erp.syncData.getSyncDataMappingBySourceDataId”, header, param3); // [false, HttpResult(statusCode=200, content={“data”:{“sourceDataId123”: {“sourceDataId”:”sourceDataId123”,”isCreated”:true,”destDataId”:”destDataId123666”,”sourceDataName”:”sourceDataName1233”,”updateTime”:1611047455451,”lastSyncStatus”:6, “destDataName”:”destDataName123”,”destTenantId”:”81138”,”sourceObjectApiName”:”AccountObj”,”destObjectApiName”:”BD_Customer.BillHead”,”sourceTenantId”:”81138”, “statusName”:”新增成功”,”id”:”aa46ed320312476485e932a1ca4b4263”,”lastSyncDataId”:”92c86fb175254e54b990bd86b6ce1145”,”status”:1}}, “errCode”:”s106240000”,”errMsg”:”Success”}, bytes=null), ] // s106240000 success, others fail // data is a Map, storing data with existing mapping relationships, key is the source data id, value is the existing corresponding relationship log.info(result3) ```

6. Custom Function to Create ERP Field Mapping Table

groovy // Legal values for channel are ERP_K3CLOUD, ERP_SAP, ERP_U8, OA, STANDARD_CHANNEL // "dataType":"employee" indicates that the creation is for personnel // dataCenterId is the data center id // fsDataId is the data id on CRM. For personnel, this is the employee ID, not the data id of the CRM personnel object. // erpDataId is the data id on ERP // fsDataName is the data name on CRM // erpDataName is the data name on ERP Map data = [ "dataCenterId": "Data center id", "channel": "ERP_K3CLOUD", "dataType": "employee", "fsDataId": "fsDataId", "fsDataName": "fsDataName", "erpDataId": "erpDataId", "erpDataName": "erpDataName" ] def ret = Fx.proxy.callAPI("erp.syncData.createErpfieldmapping", [:], data); Fx.log.info("ret is : " + ret)
Submit Feedback