文档API 参考

Rust · 0.1.0

List Memos

GET /api/v1/memos

MemoService · MemoService_ListMemos

基于协议生成的参考。授权与实例策略仍然生效。结构描述继承自 MIT 许可的应用接口定义;本站不会向真实服务执行示例。

访问权限

仅实例允许公开访问时才接受匿名调用;已认证调用仍受资源可见性和操作筛选规则限制。

列表范围与筛选

此列表排除评论,默认状态为 NORMAL。ARCHIVED 仅返回调用者自己的归档笔记。协议声明了 showDeleted,但它没有实现回收站查询,删除是永久性的。筛选时间字段是 created_ts/updated_ts,orderBy 使用 create_time/update_time。指定空间的筛选要求该空间成员资格。直接使用返回的分页令牌,不要自行解码或构造。

curl --fail-with-body --get \
  -H "Authorization: Bearer $MEMOS_TOKEN" \
  --data-urlencode "pageSize=20" \
  --data-urlencode 'filter=pinned == true' \
  --data-urlencode "orderBy=update_time desc" \
  "$MEMOS_URL/api/v1/memos"

请求

ListMemos lists readable non-comment memos with pagination and filter.

GET/api/v1/memos

参数

名称 / 位置类型 / 是否必需描述
pageSize
query
integer (int32)
OpenAPI 未标记为必需
Optional. The maximum number of memos to return. The service may return fewer than this value. If unspecified, at most 50 memos will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
pageToken
query
string
OpenAPI 未标记为必需
Optional. A page token, received from a previous `ListMemos` call. Provide this to retrieve the subsequent page.
state
query
string (enum)
STATE_UNSPECIFIED · NORMAL · ARCHIVED
OpenAPI 未标记为必需
Optional. The state of the memos to list. Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
orderBy
query
string
OpenAPI 未标记为必需
Optional. The order to sort results by. Default to "create_time desc". Supports comma-separated list of fields following AIP-132. Example: "pinned desc, create_time desc" or "update_time asc" Supported fields: pinned, create_time, update_time, name. Note: order_by uses create_time / update_time, while the filter expression uses created_ts / updated_ts for the same timestamps.
filter
query
string
OpenAPI 未标记为必需
Optional. A CEL expression to filter memos. Combine terms with && and ||. Available fields: content (string), creator (string, e.g. "users/1"), created_ts / updated_ts (timestamp), pinned (bool), visibility (string: PRIVATE | PROTECTED | PUBLIC | SPACE), space (string resource name, or null when the memo has no space; supports == and comparisons against null, e.g. space != null), tags (list<string>; match with `"work" in tags`, not `tag == "work"`), has_task_list / has_link / has_code / has_incomplete_tasks (bool), has_location (bool; true when the memo has a location attached). Note: the time fields here are created_ts / updated_ts, which differ from the create_time / update_time names used by order_by. Examples: pinned == true && visibility == "PUBLIC" space == "spaces/team" or space == null tags.exists(t, t == "urgent") content.contains("roadmap") && created_ts > now - duration("168h")
showDeleted
query
boolean
OpenAPI 未标记为必需
Optional. If true, show deleted memos in the response.

请求体

未声明请求体。

响应

200 · OK

application/json · ListMemosResponse

default · Default error response

application/json · Status

完整操作定义

下方保留全部已声明约束、媒体类型和响应细节。结构引用链接到完整定义。

展开 JSON 定义
{
  "tags": [
    "MemoService"
  ],
  "description": "ListMemos lists readable non-comment memos with pagination and filter.",
  "operationId": "MemoService_ListMemos",
  "parameters": [
    {
      "name": "pageSize",
      "in": "query",
      "description": "Optional. The maximum number of memos to return.\n The service may return fewer than this value.\n If unspecified, at most 50 memos will be returned.\n The maximum value is 1000; values above 1000 will be coerced to 1000.",
      "schema": {
        "type": "integer",
        "format": "int32"
      }
    },
    {
      "name": "pageToken",
      "in": "query",
      "description": "Optional. A page token, received from a previous `ListMemos` call.\n Provide this to retrieve the subsequent page.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "state",
      "in": "query",
      "description": "Optional. The state of the memos to list.\n Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.",
      "schema": {
        "enum": [
          "STATE_UNSPECIFIED",
          "NORMAL",
          "ARCHIVED"
        ],
        "type": "string",
        "format": "enum"
      }
    },
    {
      "name": "orderBy",
      "in": "query",
      "description": "Optional. The order to sort results by.\n Default to \"create_time desc\".\n Supports comma-separated list of fields following AIP-132.\n Example: \"pinned desc, create_time desc\" or \"update_time asc\"\n Supported fields: pinned, create_time, update_time, name.\n Note: order_by uses create_time / update_time, while the filter\n expression uses created_ts / updated_ts for the same timestamps.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "filter",
      "in": "query",
      "description": "Optional. A CEL expression to filter memos. Combine terms with && and ||.\n Available fields:\n   content (string), creator (string, e.g. \"users/1\"),\n   created_ts / updated_ts (timestamp), pinned (bool),\n   visibility (string: PRIVATE | PROTECTED | PUBLIC | SPACE),\n   space (string resource name, or null when the memo has no space;\n     supports == and comparisons against null, e.g. space != null),\n   tags (list<string>; match with `\"work\" in tags`, not `tag == \"work\"`),\n   has_task_list / has_link / has_code / has_incomplete_tasks (bool),\n   has_location (bool; true when the memo has a location attached).\n Note: the time fields here are created_ts / updated_ts, which differ from\n the create_time / update_time names used by order_by.\n Examples:\n   pinned == true && visibility == \"PUBLIC\"\n   space == \"spaces/team\" or space == null\n   tags.exists(t, t == \"urgent\")\n   content.contains(\"roadmap\") && created_ts > now - duration(\"168h\")",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "showDeleted",
      "in": "query",
      "description": "Optional. If true, show deleted memos in the response.",
      "schema": {
        "type": "boolean"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ListMemosResponse"
          }
        }
      }
    },
    "default": {
      "description": "Default error response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Status"
          }
        }
      }
    }
  }
}