Creating new sheet using Java API - Unable to create child tasks

I am trying to create a smartsheet using Java API that fills data in parent/child task format. I tried couple of options, but I was getting exception. I am not sure if it is possible.

So, I tried another option, where I created the sheet and then re-read the sheet and tried to indent the rows using following code - 

// Indent child Rows

        List<Row> rows = checkPointSheetData.getSheet().getRows();

        SmartsheetUtility smartsheetUtility = new SmartsheetUtility();

        List<Row> indentedRows = new ArrayList<>();

        for(Row taskRow : rows) {

            try {

                WorkItemData workItemData = smartsheetUtility.getWorkItemData(taskRow, null, checkPointSheetData.getSheet().getColumns(),

                        checkPointSheetData.getColumnMap().get(SmartSheetAppConstants.SMARTSHEET_COL_TASK_NAME));     // WorkItemData is a POJO class contains the row data of smartsheet

                if(workItemData.getTaskName() != null && !workItemData.getTaskName().startsWith(getCheckPointPattern())) {

                    Row newRow = new Row(taskRow.getId());




                    checkPointSheetData.getSmartsheet().sheetResources().rowResources().updateRows(getCheckPointSheetId(), indentedRows);



            } catch (ParseException parseException) {

                APPLOGGER.error(parseException.getMessage(), parseException);



While running above code I am getting exception - 

2019-07-15 10:54:00 WARN  DefaultHttpClient:153 - {request:{command:'PUT',headers:{'Accept-Encoding':'gzip,deflate','Authorization':'Bearer ****wll2','Connection':'Keep-Alive','Content-Length':'36','Content-Type':'application/json','Host':'','User-Agent':'Smartsheet Java SDK/2.2.9/smartsheet-sdk-java-2.2.9.jar!com.smartsheet.api.SmartsheetFactory/Windows 10 Java HotSpot(TM) 64-Bit Server VM Oracle Corporation 1.8.0_151',},body:'[{"id":3407430094219140,"indent":1}]'},response:{status:'HTTP/1.1 404 Not Found',headers:{'Connection':'Keep-Alive','Content-Type':'application/json;charset=UTF-8','Date':'Mon, 15 Jul 2019 05:23:58 GMT','Keep-Alive':'timeout=5, max=27','Vary':'Accept-Encoding',},body:'{

  "errorCode" : 1006,

  "message" : "Not Found",

  "refId" : "15bj685inr0r1",

  "detail" : {

    "index" : 0,

    "rowId" : 3407430094219140



2019-07-15 10:54:00 ERROR IdentifyCheckPointGoals:124 - Not Found

com.smartsheet.api.ResourceNotFoundException: Not Found

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(

    at java.lang.reflect.Constructor.newInstance(

    at com.smartsheet.api.internal.AbstractResources$ErrorCode.getException(

    at com.smartsheet.api.internal.AbstractResources.handleError(

    at com.smartsheet.api.internal.AbstractResources.putAndReceiveList(

    at com.smartsheet.api.internal.SheetRowResourcesImpl.updateRows(

    at com.smartsheet.main.IdentifyCheckPointGoals.updateCheckPointGoalSheet(

    at com.smartsheet.main.IdentifyCheckPointGoals.updateCheckPointGoals(

    at com.smartsheet.main.IdentifyCheckPointGoals.main(


Can anyone please help me here to understand how I can establish parent/child task while creating a new smartsheet ?


  • You can have a sheet that ultimately has hierarchy; however, the flow would be to create the sheet first > then add the rows with the data > and then update the rows to create the hierarchy. So doing it all in one action is why there is a problem. Both the sheet and the rows have to exist first as you'll need sheetId and rowIds to carry out the request.