> ## Documentation Index
> Fetch the complete documentation index at: https://wukong.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取频道最大消息序号

> 获取指定频道的最大消息序号

## 概述

获取指定频道的最大消息序号，用于消息同步和状态检查。

## 查询参数

<ParamField query="channel_id" type="string" required>
  频道 ID
</ParamField>

<ParamField query="channel_type" type="integer" required>
  频道类型 (1=个人频道, 2=群组频道)
</ParamField>

<ParamField query="login_uid" type="string" required>
  当前登录用户 ID
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "http://localhost:5001/channel/max_message_seq?channel_id=group123&channel_type=2&login_uid=user123"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('http://localhost:5001/channel/max_message_seq?channel_id=group123&channel_type=2&login_uid=user123');
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  params = {
      'channel_id': 'group123',
      'channel_type': 2
  }

  response = requests.get('http://localhost:5001/channel/max_message_seq', params=params)
  data = response.json()
  print(data)
  ```

  ```go Go theme={null}
  package main

  import (
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      resp, err := http.Get("http://localhost:5001/channel/max_message_seq?channel_id=group123&channel_type=2&login_uid=user123")
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()
      
      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Printf("%+v\n", result)
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 成功响应 theme={null}
  {
    "message_seq": 1500
  }
  ```

  ```json 频道不存在 theme={null}
  {
    "message_seq": 0
  }
  ```
</ResponseExample>

## 响应字段

<ResponseField name="message_seq" type="integer" required>
  频道的最大消息序号，如果频道不存在或没有消息则返回 0
</ResponseField>

## 状态码

| 状态码 | 说明         |
| --- | ---------- |
| 200 | 成功获取最大消息序号 |
| 400 | 请求参数错误     |
| 500 | 服务器内部错误    |
