API for Lab

Lucidum also provides API access for the Lab tables. User can use the Lab API to find the file upload histories, compare two file uploads, and save the comparison results.

 

API for querying file upload history under a single Lab table

 

Below is an example of this API call:

 

Endpoint: /CMDB/api/upload/customer/collection_history

REST method: GET

Request body:

{

“sort”:”__lucidum__uploadtime__, asc”,

“tableName”: “_TableName_”

}

 

  • Sort: Upload history sorting order
  • TableName: Lab table name with the file upload history

 

Below is an example of the API response:

{

“content”: [{

“_id”: “5f68cbf1adf81c00016d5a75”,

“__lucidum__uploadtime__”: 1600703472,

“table_name”: “MyCSVTable”,

“model”: “create”,

“creator”: “admin”,

“file_name”: “user1_table.csv”,

“table_description”: “MyCSVTable”,

“upload_remark”: “upload user1_table”,

“version”: 1.0,

“upload_id”: 61

}, {

“_id”: “5f68cc49adf81c00016d5a7c”,

“__lucidum__uploadtime__”: 1600703561,

“table_name”: “MyCSVTable”,

“model”: “updateAppend”,

“creator”: “admin”,

“file_name”: “user2_table.csv”,

“table_description”: “MyCSVTable”,

“upload_remark”: “1600703561#user2_table.csv”,

“version”: 2.0,

“upload_id”: 62

}]

}

 

API for comparing file upload histories and getting comparison results

 

Below is an example of this API call. The API response includes the comparison results, which can be saved as an Excel spreadsheet if needed.

 

Endpoint: /CMDB/api/upload/customer/collection_history/export?params=

REST method: GET

Request body: none

params: URL encoded string of json as following

{

compareModel: “ALL”

firstId: “first upload id”

lastId: “last upload id”

groupBys: {

“field1”: “field2”

}

}

  • CompareModel: Comparison filter. Valid values are “ALL” (including all records in comparison), “DELETED” (including records not from lastId only), “MODIFIED” (including records changed from lastId only), and “ADDED” (including new records from lastId only)
  • FirstId: First file upload history (as the base for comparison)
  • LastId: Second file upload history
  • GroupBys: field1 is the “Compared by” field from the first file upload, and field2 is the “Compared by” field from the second file upload, which are the internal keys to link these two file uploads

Leave a Reply

Your email address will not be published. Required fields are marked *