
# 查询待办的详情 - ShowTask
#### 功能介绍
查询待办的详情
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-secmaster/secmaster_03_0008.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-secmaster/secmaster_03_0023.html)。
#### URI
GET /v1/{project_id}/workspaces/{workspace_id}/soc/tasks/{task_id}
表1路径参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                          |
|:---|:---|:---|:---|
| project_id   | 是    | String | **参数解释：** 项目ID，用于明确项目归属，配置后可通过该ID查询项目下资产，可以通过调用API获取，也可以从控制台获取。[获取项目ID](https://support.huaweicloud.com/api-secmaster/secmaster_03_0014.html) **约束限制：** 不涉及 **取值范围：** 不涉及 **默认取值：** 不涉及 |
| workspace_id | 是    | String | **参数解释**: 工作空间ID **取值范围**: 不涉及                                                                                                                                                                                                                                                                          |
| task_id      | 是    | String | **参数解释**: 待办任务的ID **取值范围**: 不涉及                                                                                                                                                                                                                                                                         |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | **参数解释**: 租户的Token **约束限制**: 不涉及 **取值范围**: 不涉及 **默认值**: 不涉及                                                                                                                                                                                                                                                                                                                     |
| Content-Type | 是    | String | **参数解释：** 内容类型 - application/json;charset=UTF-8 普通API请求的类型    **约束限制：** 不涉及 **取值范围：** - application/json;charset=UTF-8    **默认取值：** 不涉及 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数         | 参数类型                                            | 描述                                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|
| code       | String                                          | **参数解释**: 错误码，当请求成功时值为 "00000000" **取值范围**: 不涉及                                                                                                                                                                                                                                            |
| message    | String                                          | **参数解释**: 错误信息的描述 **取值范围**: 不涉及                                                                                                                                                                                                                                                            |
| request_id | String                                          | **参数解释**: 请求的ID **约束限制**: 不涉及                                                                                                                                                                                                                                                              |
| success    | Boolean                                         | **参数解释**: 是否成功 **取值范围**: - true 成功   - false 失败    |
| data       | [TaskInfo] object | Information of task                                                                                                                                                                                                                                                                                                                                                            |
   
 表4TaskInfo 
| 参数                 | 参数类型                                                                    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|
| id                 | String                                                                  | **参数解释**: 待办任务的ID **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| aopengine_task_id  | String                                                                  | **参数解释**: 待办任务的引擎任务Id **取值范围**: 不涉及.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| name               | String                                                                  | **参数解释**: 待办任务的名称 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| project_id         | String                                                                  | **参数解释**: 待办任务的项目Id **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| description        | String                                                                  | **参数解释**: 待办任务的描述 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| create_time        | String                                                                  | **参数解释**: 待办的创建时间 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| creator_id         | String                                                                  | **参数解释**: 待办的创建者ID **取值范围**: system                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| creator_name       | String                                                                  | **参数解释**: 待办的创建者名字 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| update_time        | String                                                                  | **参数解释**: 待办的更新时间 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| modifier_id        | String                                                                  | **参数解释**: 待办的修改者ID **取值范围**: system                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| modifier_name      | String                                                                  | **参数解释**: 待办的修改者名字 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| approveuser_id     | String                                                                  | **参数解释**: 待办支持的审核人用户ID **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| approveuser_name   | String                                                                  | **参数解释**: 待办支持的审核人用户名字 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| approver           | String                                                                  | **参数解释**: 待办审核人用户名称 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| notes              | String                                                                  | **参数解释**: 待办的备注 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| definition_key     | String                                                                  | **参数解释**: 待办的节点流程拓扑图的KEY **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| note               | String                                                                  | **参数解释**: 待办的备注 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| due_date           | String                                                                  | **参数解释**: 待办的超期时间 **取值范围**: 默认为创建时间+15天                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| action_id          | String                                                                  | **参数解释**: 待办的节点的流程或剧本ID 当 business_type是WORKFLOWPUBLISH或者WORKFLOWNODEAPPROVE，此时为流程ID 当 business_type是PLAYBOOKPUBLISH或者PLAYBOOKNODEAPPROVE，此时为剧本ID **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| action_version_id  | String                                                                  | **参数解释**: 待办的节点的流程或剧本版本ID 当 business_type是WORKFLOWPUBLISH或者WORKFLOWNODEAPPROVE，此时为流程版本ID 当 business_type是PLAYBOOKPUBLISH或者PLAYBOOKNODEAPPROVE，此时为剧本版本ID **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| action_instance_id | String                                                                  | **参数解释**: 待办的节点的流程或剧本的实例ID 当 business_type是WORKFLOWNODEAPPROVE，此时为流程实例ID 当 business_type是PLAYBOOKNODEAPPROVE，此时为剧本实例ID **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| workspace_id       | String                                                                  | **参数解释**: 待办任务的空间ID **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| review_comments    | String                                                                  | **参数解释**: 待办任务审核意见 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| view_parameters    | String                                                                  | **参数解释**: 待办任务查看参数 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| handle_parameters  | String                                                                  | **参数解释**: 待办任务的人工处理参数 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| business_type      | String                                                                  | **参数解释**: 待办的业务类型 - WORKFLOWPUBLISH 流程发布   - WORKFLOWNODEAPPROVE 流程节点审核   - PLAYBOOKPUBLISH 剧本发布   - PLAYBOOKNODEAPPROVE 剧本节点审核    **取值范围**: - WORKFLOWPUBLISH   - WORKFLOWNODEAPPROVE   - PLAYBOOKPUBLISH   - PLAYBOOKNODEAPPROVE    |
| related_object     | String                                                                  | **参数解释**: 待办任务的关联的流程 or 剧本名称 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| attachment_id_list | Array of strings                                                        | **参数解释**: 待办节点的附件ID列表 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| comments           | Array of [TaskCommentInfo] objects | **参数解释**: 待办节点的待办评论 **取值范围**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| status             | String                                                                  | **参数解释**: 待办的业务类型 - waiting 待处理   - canceled 已取消   - finished 已完成    **取值范围**: - waiting   - canceled   - finished                                                                                                                                                                                                                                                                                                                                |
| due_handle         | String                                                                  | **参数解释**: 待办的到期处理方式 - CONTINUE 继续执行   - INTERRUPT 终止    **取值范围**: - CONTINUE   - INTERRUPT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   
 表5TaskCommentInfo 
| 参数        | 参数类型   | 描述                                                                                                                      |
|:---|:---|:---|
| id        | String | **参数解释**: 待办评论ID **取值范围**: 不涉及      |
| message   | String | **参数解释**: 待办评论信息 **取值范围**: 不涉及      |
| user_id   | String | **参数解释**: 创建待办评论的用户ID **取值范围**: 不涉及 |
| user_name | String | **参数解释**: 创建待办评论的用户名称 **取值范围**: 不涉及 |
| time      | Long   | **参数解释**: 创建待办评论的时间 **取值范围**: 不涉及   |
   
**状态码：400**
表6响应Body参数 
| 参数      | 参数类型   | 描述                                                                                                               |
|:---|:---|:---|
| code    | String | **参数解释**: 错误码 **取值范围**: 不涉及  |
| message | String | **参数解释**: 错误描述 **取值范围**: 不涉及 |
   
#### 请求示例
无
#### 响应示例
**状态码：200**
Response of task information
```
{
  "code" : "00000000",
  "data" : {
    "id" : "3e4c170e-7cc9-11f0-9216-fa163e209978",
    "aopengine_task_id" : "3e4c170e-7cc9-11f0-9216-fa163e209978",
    "name" : "test task",
    "project_id" : "15645222e8744afa985c93dab6341da6",
    "description" : "",
    "create_time" : "2025-08-19T14:53:42.424Z+0800",
    "creator_id" : "",
    "creator_name" : "XXXX",
    "modifier_id" : "",
    "modifier_name" : "",
    "update_time" : "2025-08-19T16:50:23.743Z+0800",
    "approveuser_id" : "",
    "approveuser_name" : "",
    "approver" : "",
    "definition_key" : "Activity_1xkg6ju",
    "notes" : "006",
    "due_date" : "2025-09-03T14:53:42.398Z+0800",
    "action_id" : "e1426fd5-bf48-3b71-8f8e-d5ca1047f68b",
    "action_version_id" : "0696648d-9d20-4e21-b1fd-24f9a6f4918c",
    "action_instance_id" : "xxxxx",
    "workspace_id" : "75645d0a-93b8-4a7f-a77c-e97009389445",
    "view_parameters" : "",
    "handle_parameters" : "",
    "review_comments" : "",
    "business_type" : "PLAYBOOKNODEAPPROVE",
    "related_object" : "test",
    "attachment_id_list" : [ ],
    "comments" : [ ],
    "due_handle" : "",
    "status" : "waiting"
  },
  "message" : "",
  "request_id" : "",
  "success" : true
}
```
#### SDK代码示例
SDK代码示例如下。
- [Java]
  ```
  package com.huaweicloud.sdk.test;
  import com.huaweicloud.sdk.core.auth.ICredential;
  import com.huaweicloud.sdk.core.auth.BasicCredentials;
  import com.huaweicloud.sdk.core.exception.ConnectionException;
  import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
  import com.huaweicloud.sdk.core.exception.ServiceResponseException;
  import com.huaweicloud.sdk.secmaster.v1.region.SecMasterRegion;
  import com.huaweicloud.sdk.secmaster.v1.*;
  import com.huaweicloud.sdk.secmaster.v1.model.*;
  public class ShowTaskSolution {
      public static void main(String[] args) {
          // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
          // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
          String ak = System.getenv("CLOUD_SDK_AK");
          String sk = System.getenv("CLOUD_SDK_SK");
          String projectId = "{project_id}";
          ICredential auth = new BasicCredentials()
                  .withProjectId(projectId)
                  .withAk(ak)
                  .withSk(sk);
          SecMasterClient client = SecMasterClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(SecMasterRegion.valueOf("<YOUR REGION>"))
                  .build();
          ShowTaskRequest request = new ShowTaskRequest();
          request.withWorkspaceId("{workspace_id}");
          request.withTaskId("{task_id}");
          try {
              ShowTaskResponse response = client.showTask(request);
              System.out.println(response.toString());
          } catch (ConnectionException e) {
              e.printStackTrace();
          } catch (RequestTimeoutException e) {
              e.printStackTrace();
          } catch (ServiceResponseException e) {
              e.printStackTrace();
              System.out.println(e.getHttpStatusCode());
              System.out.println(e.getRequestId());
              System.out.println(e.getErrorCode());
              System.out.println(e.getErrorMsg());
          }
      }
  }
  ```
- [Python]
  ```
  # coding: utf-8
  import os
  from huaweicloudsdkcore.auth.credentials import BasicCredentials
  from huaweicloudsdksecmaster.v1.region.secmaster_region import SecMasterRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdksecmaster.v1 import *
  if __name__ == "__main__":
      # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak = os.environ["CLOUD_SDK_AK"]
      sk = os.environ["CLOUD_SDK_SK"]
      projectId = "{project_id}"
      credentials = BasicCredentials(ak, sk, projectId)
      client = SecMasterClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = ShowTaskRequest()
          request.workspace_id = "{workspace_id}"
          request.task_id = "{task_id}"
          response = client.show_task(request)
          print(response)
      except exceptions.ClientRequestException as e:
          print(e.status_code)
          print(e.request_id)
          print(e.error_code)
          print(e.error_msg)
  ```
- [Go]
  ```
  package main
  import (
  "fmt"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
      secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/region"
  )
  func main() {
      // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak := os.Getenv("CLOUD_SDK_AK")
      sk := os.Getenv("CLOUD_SDK_SK")
      projectId := "{project_id}"
      auth, err := basic.NewCredentialsBuilder().
          WithAk(ak).
          WithSk(sk).
          WithProjectId(projectId).
          SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      hcClient, err := secmaster.SecMasterClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := secmaster.NewSecMasterClient(hcClient)
      request := &model.ShowTaskRequest{}
  request.WorkspaceId = "{workspace_id}"
  request.TaskId = "{task_id}"
  response, err := client.ShowTask(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/SecMaster/sdk?api=ShowTask&version=v1)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述                           |
|:---|:---|
| 200 | Response of task information |
| 400 | Error response               |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-secmaster/ErrorCode.html)。
