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

Query the Generic-Protocol Configuration List

Function

This API is used to query the generic-protocol configuration list.

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:queryList

    List

    instance *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    -

    -

URI

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

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.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Number of records to be displayed on each page. The value is an integer ranging from 1 to 50. The default value is 10.

marker

No

String

ID of the last record in the previous query. The value is returned by the platform during the previous query. Records are queried in descending order of record IDs (the marker value). A newer record will have a larger ID. If marker is specified, only the records whose IDs are smaller than marker are queried. If marker is not specified, the query starts from the record with the largest ID, that is, the latest record. If all data needs to be queried in sequence, this parameter must be filled with the value of marker returned in the last query response each time.

offset

No

Integer

If offset is set to N, the query starts from the N+1 record after the last record in the previous query. The value is an integer ranging from 0 to 500. The default value is 0. If offset is set to 0, the output starts from the first record after the last record in the previous query. To ensure API performance, you can use this parameter together with marker to turn pages. For example, if there are 50 records on each page, you can directly specify offset to jump to the specified page within page 1 and 11. If you want to view records displayed on pages 12 to 22, you need to use the marker value returned on page 11 as the marker value for the next query.

Request Parameters

Table 3 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 4 Response body parameters

Parameter

Type

Description

protocol_configs

Array of ProtocolConfigBase objects

Generic-protocol configuration list

page

Page object

Pagination information of the query results.

Table 5 ProtocolConfigBase

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 6 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.

Table 7 Page

Parameter

Type

Description

count

Long

Total number of records that meet the filter criteria.

marker

String

ID of the last record in this query, which can be used in the next query.

Example Requests

Queries the generic-protocol configuration list.

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

Example Responses

Status code: 200

{
  "protocol_configs" : [ {
    "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"
  } ],
  "page" : {
    "marker" : "ffffffffffffffffffffffffffffffff",
    "count" : 1
  }
}

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.