Updated on 2026-09-30 GMT+08:00

Query Details About a Generic-Protocol Configuration

Function

This API is used to query details about a generic-protocol configuration.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    iotda:protocolconfigs:query

    Read

    instance *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    -

    -

URI

GET /v5/iot/{project_id}/protocol-configs/{protocol_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description : project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

protocol_id

Yes

String

Parameter description: ID of the generic-protocol configuration.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Instance-Id

No

String

Parameter description : instance ID. Unique identifier of each instance in the physical multi-tenant scenario. Mandatory for professional editions and recommended in other cases. Log in to the IoTDA console and choose Overview in the navigation pane to view the instance ID. For details, see Viewing Instance Details.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

protocol_id

String

Parameter description: ID of the generic-protocol configuration.

port

Integer

Parameter description: port number configured for the generic protocol.

keepalive_timeout

Integer

Parameter description: connection idle timeout, in seconds.

protocol_type

String

Parameter description: protocol type.

Value: TCP (general TCP access).

description

String

Parameter description: description of the generic protocol.

Value: The value can contain a maximum of 2,048 characters. Only letters, digits, and special characters (_?'#().,&%@!-) are allowed.

ssl_enable

Boolean

Parameter description: whether to enable TLS encrypted transmission.

frame_decode_configs

Array of FrameDecodeConfig objects

Parameter description: stream segmentation/reassembly configuration list.

codec_mode

String

Parameter description: Codec type.

Value:

  • FGS: The codec plug-in is deployed to FunctionGraph as a function.

  • PLUGIN: The codec plug-in is deployed to IoTDA as an OSGi plug-in. To use this mode, submit a service ticket to contact technical support.

func_urn

String

Parameter description: Uniform Resource Name (URN) of a function, which uniquely identifies the function. It is the address of the function that uses FGS for encoding and decoding.

Value: The value can contain a maximum of 256 characters. Only letters, digits, underscores (_), hyphens (-), and colons (:) are allowed.

create_time

String

Parameter description: time when the custom authentication is queried in the IoT platform. The value is in the format of yyyyMMdd'T'HHmmss'Z', for example, 20151212T121212Z.

update_time

String

Parameter description: updated time when the custom authentication is queried in the IoT platform. The value is in the format of yyyyMMdd'T'HHmmss'Z', for example, 20151212T121212Z.

Table 4 FrameDecodeConfig

Parameter

Type

Description

frame_decode_type

String

Parameter description: packet segmentation and reassembly rule.

Value:

  • DELIMITER: Data packets are split or combined using specific delimiters (such as commas and newline characters).

  • FIXED_LENGTH: Each frame of data is split or combined based on a fixed byte length.

  • FIELD_LENGTH: The length of each frame is variable. Data packets are split or combined based on the length field carried in the packets.

max_frame_length

Integer

Parameter description: maximum length of a single frame. This parameter is mandatory when the segmentation rule is DELIMITER|FIELD_LENGTH.

delimiter

String

Parameter description: delimiter, in hex string format. This parameter is mandatory when the segmentation rule is DELIMITER.

fixed_frame_length

Integer

Parameter description: fixed length of a single frame. This parameter is mandatory when the segmentation rule is FIXED_LENGTH.

field_offset

Integer

Parameter description: start position (offset) of the specified length field in the data packet. This parameter is mandatory when the segmentation rule is FIELD_LENGTH.

field_length

Integer

Parameter description: number of bytes occupied by the specified length field. This parameter is mandatory when the segmentation rule is FIELD_LENGTH.

initial_bytes

String

Parameter description: start character, in hex string format. This parameter is optional when the segmentation rule is FIXED_LENGTH.

adjustment_length

Integer

Parameter description: value of the adjustment length field. This parameter is optional when the segmentation rule is FIELD_LENGTH.

initial_bytes_to_strip

Integer

Parameter description: number of bytes to be removed from the data packet after decoding. Generally, this parameter is used to remove the length field and retain only the data content. This parameter is optional when the segmentation rule is FIELD_LENGTH.

Example Requests

Queries details about a generic-protocol configuration with a specified ID.

GET https://{endpoint}/v5/iot/{project_id}/protocol-configs/{protocol_id}

Example Responses

Status code: 200

{
  "protocol_id" : "9739d740-4da1-46e1-8075-77145265cd92",
  "port" : 6886,
  "protocol_type" : "TCP",
  "description" : "tcp protocol",
  "frame_decode_configs" : [ {
    "frame_decode_type" : "DELIMITER",
    "max_frame_length" : 200,
    "delimiter" : "]"
  } ],
  "codec_mode" : "FGS",
  "keepalive_timeout" : 600,
  "ssl_enable" : true,
  "func_urn" : "urn:fss:cn-north-5:d92d9c5eb8e347b5bb31ecfe5bc0c4e1:function:default:mqtt_auth:latest",
  "create_time" : "20231031T070547Z",
  "update_time" : "20231031T070547Z"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.