Updated on 2024-04-08 GMT+08:00

Querying a Transaction

Function

This API is used to query a transaction.

URI

GET /v1/{project_id}/templates/{template_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

Minimum: 0

Maximum: 64

template_id

Yes

Integer

Transaction ID.

Minimum: 0

Maximum: 2147483647

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

code

String

Response code.

Minimum: 0

Maximum: 1024

message

String

Response message.

Minimum: 0

Maximum: 1024

temp_info

TempInfo object

Transaction details.

Table 3 TempInfo

Parameter

Type

Description

id

Integer

Transaction ID.

Minimum: 0

Maximum: 2147483647

project_id

Integer

Project ID.

Minimum: 0

Maximum: 2147483647

name

String

Transaction name.

Minimum: 0

Maximum: 1024

description

String

Transaction description.

Minimum: 0

Maximum: 1024

variables

String

Variable.

Minimum: 0

Maximum: 1024

contents

Array of objects

Transaction script information.

Array Length: 0 - 1024

temp_type

Integer

Transaction type (deprecated).

Minimum: 0

Maximum: 2147483647

for_loop_params

Array of objects

Logic controller field of the old edition. This parameter is not used in the current edition.

Array Length: 0 - 1024

logic_controller

LogicController object

Logic controller information.

enable_pre

Boolean

Whether to enable the preset transaction. This parameter is not used in the current edition.

Table 4 LogicController

Parameter

Type

Description

for_loop_params

String

Logic controller field of the old edition. This parameter is not used in the current edition.

Minimum: 0

Maximum: 1024

condition

String

Logic controller condition.

Minimum: 0

Maximum: 1024

Example Requests

Querying details about the transaction whose ID is 1.

/v1/{project_id}/templates/1

{
  "code" : "SVCSTG.CPTS.0000000",
  "message" : "success",
  "temp_info" : {
    "id" : 155175,
    "project_id" : 403931,
    "name" : "test",
    "description" : "",
    "variables" : null,
    "contents" : [ {
      "content_id" : 155175,
      "content" : [ {
        "content_type" : 2,
        "content" : {
          "_adressValue" : "http://1.1.1.1",
          "body_type" : 0,
          "bodys" : [ ],
          "check_end_length" : null,
          "check_end_str" : null,
          "check_end_type" : null,
          "connect_timeout" : 5000,
          "connect_type" : 1,
          "headers" : [ {
            "key" : "Content-Type",
            "value" : "application/json"
          } ],
          "http_version" : "HTTP/1.1",
          "method" : "GET",
          "name" : "Msg-8015",
          "protocol_type" : 1,
          "return_timeout" : 5000,
          "return_timeout_param" : null,
          "url" : "http://1.1.1.1"
        }
      } ],
      "index" : -1,
      "selected_temp_name" : "",
      "data" : null,
      "data_type" : 0,
      "conditions" : null,
      "is_disabled" : false,
      "is_continue" : false
    } ],
    "temp_type" : 0,
    "for_loop_params" : [ ],
    "logic_controller" : {
      "for_loop_params" : null,
      "condition" : null
    },
    "enable_pre" : false
  }
}

Example Responses

Status code: 200

success

{
  "code" : "SVCSTG.CPTS.0000000",
  "message" : "success",
  "temp_info" : {
    "id" : 21531,
    "project_id" : 17543,
    "name" : "transaction",
    "description" : "",
    "variables" : null,
    "contents" : [ {
      "content_id" : 21531,
      "content" : [ {
        "content_type" : 2,
        "content" : {
          "body_type" : 0,
          "bodys" : [ ],
          "check_end_length" : null,
          "check_end_str" : null,
          "check_end_type" : null,
          "connect_timeout" : 5000,
          "connect_type" : 1,
          "headers" : [ {
            "key" : "Content-Type",
            "value" : "application/json"
          } ],
          "http_version" : "HTTP/1.1",
          "method" : "GET",
          "name" : "Msg-73387",
          "protocol_type" : 2,
          "return_timeout" : 5000,
          "return_timeout_param" : null,
          "url" : "https://www.domain-example.com"
        }
      } ],
      "index" : -1,
      "selected_temp_name" : "",
      "data" : null,
      "data_type" : 0,
      "conditions" : null,
      "is_disabled" : false,
      "is_continue" : false
    } ],
    "temp_type" : 0,
    "for_loop_params" : [ ],
    "logic_controller" : {
      "for_loop_params" : null,
      "condition" : null
    },
    "enable_pre" : false
  }
}

Status Codes

Status Code

Description

200

success

501

unknown error

Error Codes

See Error Codes.