如何获取我从副本创建的新 folder/sheet 的 ID?

How do I get the ID of a new folder/sheet that I have created from a copy?

当我在 smartsheet 中复制文件夹时,有没有办法获取新文件夹的 ID?

到目前为止我尝试过的是:

inc_list = ['all'] # you can add other parameters here, separated by a comma
 response = ss_client.Folders.copy_folder(
 folderID,                           # folder_id
 ss_client.models.ContainerDestination({
'destination_id': destinationID,
'destination_type': 'folder',
'new_name': cellValue
}),
include=inc_list
)

folder = ss_client.Folders.get_folder(
destinationID)       # folder_id

print (folder)

这给了我一个看起来像这样的长回复:

{"folders": [{"id": 1261015317931908, "name": "Title Test Cell", "permalink": "permalink goes here"}], "id":6664015456823172,"name":"Smartsheet Folder Destination","permalink":"permalink goes here (I edited it)"}

如何只获取新文件夹的 ID?

当您创建新文件夹(或从现有文件夹复制)时,响应将包含新文件夹的多个属性,包括 ID。其他的属性如果不需要,可以忽略。

来自API docs

{
  "message": "SUCCESS",    
  "resultCode": 0,
  "result": {
    "id": 7116448184199044,
    "name": "newFolderName",
    "permalink": "https://{base_url}?lx=lB0JaOh6AX1wGwqxsQIMaA"
  }
}

因此在 Python 中,在您收到回复后:

folder_id = response.result.id