---
title: "获取协议脚本列表"
method: POST
path: "/api/v1/things/protocol/script/index"
tags: ["things/protocol/script", "thingsProtocolScript"]
---

# 获取协议脚本列表

`POST /api/v1/things/protocol/script/index`

## Request body

- ProtocolScriptIndexReq
  - `name` string
  - `page` PageInfo
    - `orders` OrderBy[] — 排序
      - `field` string — 排序的字段名
      - `sort` integer — 排序方式：1 从小到大, 2 从大到小
    - `page` integer — 页码
    - `size` integer — 每页大小
  - `status` integer — 状态:是否启用
  - `triggerDir` integer — 1:up 2:down
  - `triggerHandle` string — 对应 mqtt topic的第一个 thing ota config 等等
  - `triggerTimer` integer — 收到前处理1:before 2:after
  - `triggerType` string — 操作类型 从topic中提取 物模型下就是 property属性 event事件 action行为

## Response `200`

A successful response.

- object
  - `code` integer
  - `data` ProtocolScriptIndexResp
    - `list` ProtocolScript[], required — 自定义协议信息
      - `createdTime` integer — 创建时间
      - `desc` string
      - `id` string
      - `name` string
      - `script` string — 脚本内容
      - `status` integer — 状态:是否启用
      - `tenantCode` string — 租户号,common 为公共的产品,公共的大家都可以看,但是只有default可以修改
      - `triggerDir` integer — 1:up 2:down
      - `triggerHandle` string — 对应 mqtt topic的第一个 thing ota config 等等
      - `triggerTimer` integer — 收到前处理1:before 2:after
      - `triggerType` string — 操作类型 从topic中提取 物模型下就是 property属性 event事件 action行为
    - `page` integer — 页码
    - `pageSize` integer — 每页大小
    - `total` integer
  - `msg` string

## Changes

- **2026-03-27** `b9582d0ab6af` — 1 breaking, 1 info
  - added required request body
  - added the media type `application/json` for the response with the status `200`
- **2025-03-14** `e87dbcac5d9e` — 2 breaking
  - removed the request body
  - removed the media type `application/json` for the response with the status `200`

[Change history](https://skmtc.dev/unitedrhino/apis/things-api/changes/api/v1/things/protocol/script/index/post.md)

---

[API](https://skmtc.dev/unitedrhino/apis/things-api.md) · [All operations](https://skmtc.dev/unitedrhino/apis/things-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/unitedrhino/things-api/revisions/f3bdeb916389/schema)
