Integrate CBS Sheet Codes with an External Data Source

To integrate CBS sheet codes with an external data source:

  1. Create or generate a JSON object containing the following fields:
    • sourceId: The unique identifier of CBS sheet code data in an external source, such as an ERP system.
    • isActive: Indicates whether or not this CBS code is active.
    • cbsCode: The CBS code that will be added to the project or workspace's CBS sheet.
    • costType: The type of cost associated with this CBS code.
    • isTotalRow: Indicates whether or not this CBS code represents a total row on the CBS sheet.
    • workspaceCode: The code of the workspace this CBS code will be associated with.
    • projectCode: The code of the project this CBS code will be associated with.
  2. Send a request to the API using the following information:
    • Endpoint: https://localhost:7001/api/restapi/project/cbs/project/syncBatch
    • Operation: POST
    • Example Request Body:
    [ 
          	{ 
          	        "sourceId": 1, 
          	        "isActive": true, 
          	        "cbsCode": "Example CBS One", 
          	        "costType": "NONE", 
          	        "isTotalRow": false, 
          	        "workspaceCode": "Example Workspace", 
          	        "projectCode": "Example Project" 
              }, 
          	{ 
          	        "sourceId": 2, 
          	        "isActive": true, 
          	        "cbsCode": "Example CBS Two", 
          	        "costType": "NONE", 
          	        "isTotalRow": false, 
          	        "workspaceCode": "Example Workspace", 
          	        "projectCode": "Example Project" 
              } 
          ]
    		
  3. The API should return a response similar to the following:
    • Response Code: 207
    • Example Response Body:
    [ 
              { 
                  "statusCode": 201, 
                  "primaryKeyName": "costItemId", 
                  "primaryKeyValue": 36217, 
                  "sourceId": "1" 
              }, 
              { 
                  "statusCode": 201, 
                  "primaryKeyName": "costItemId", 
                  "primaryKeyValue": 36218, 
                  "sourceId": "2" 
              } 
          ]