WeChat-Media-Platform-V2-API

获取公众号服务/自定义菜单/Get WeChat MP Account Services & Custom Menu

Changed on

[中文]

用途:

  • 传 gh_username,返回公众号底部的自定义菜单 / 服务入口。未配置自定义菜单的账号返回空菜单。
  • 价格:0.01$/次
  • ⏱️ 由于微信服务器原因,本接口响应较慢,请将客户端请求超时(timeout)设置为 30 秒;timeout 设置过小会造成已扣费但收不到响应的情况。

参数:

  • username: 公众号 gh_username(gh_…)。示例 gh_363b924965e9
  • raw: 可选,默认 True。True=原始;False=精简解析。

返回:

  • 公众号自定义菜单 / 服务入口

响应结构与 JSON Path:

raw=false(精简解析,snake_case):

  • 公众号 username: $.data.biz_username
  • 菜单项列表(无菜单时为 []): $.data.menu[] —— 每项为菜单按钮(名称 / 类型 / 子菜单 / 跳转),无自定义菜单的账号该数组为空。

raw=true(原始,本接口默认):

  • data 为完整原始菜单结构。未配置菜单的账号返回空对象 {}。
  • 精简版的 menu[] 即由此原始结构提取而来。

[English]

Purpose:

  • Pass a gh_username to get the custom menu / service entries at the bottom of the official account. Accounts without a custom menu return an empty menu.
  • Price: $0.01 per request
  • ⏱️ Due to WeChat server latency, this endpoint responds slowly; please set your client request timeout to 30 seconds — a timeout that is too small may result in being billed without receiving the response.

Parameters:

  • username: Official account gh_username (gh_…). E.g. gh_363b924965e9
  • raw: Optional, default True. True=raw; False=simplified parsing.

Return:

  • Custom menu / service entries of the official account

Response structure & JSON Path:

raw=false (simplified, snake_case):

  • Account username: $.data.biz_username
  • Menu item list ([] when no menu): $.data.menu[] — each item is a menu button (name / type / sub-menu / jump); the array is empty for accounts without a custom menu.

raw=true (raw, default for this endpoint):

  • data is the full raw menu structure. Accounts without a configured menu return an empty object {}.
  • The simplified menu[] is extracted from this raw structure.
post/api/v1/wechat_mp/v2/fetch_account_services

Request

  • Base URL
    https://api.tikhub.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Request body

usernamestring required

公众号 username。三种形态都支持:gh_…、gh_…@app(关联小程序的账号)、以及自定义微信号(如 nikejdi)。取自文章详情接口响应的 $.data.content.user_name/Official account username. Three forms are supported: gh_…, gh_…@app (mini-program-linked accounts) and custom WeChat IDs (e.g. nikejdi). Taken from $.data.content.user_name of the article detail endpoints

rawboolean

True=原始响应;False=精简解析结构/True=raw response; False=simplified parsed structure

Example request

{
  "username": "gh_363b924965e9"
}

Response

Successful Response

codeinteger

HTTP status code | HTTP状态码

request_idstring nullable

Unique request identifier | 唯一请求标识符

messagestring

Response message (EN-US) | 响应消息 (English)

message_zhstring

Response message (ZH-CN) | 响应消息 (中文)

supportstring

Support message | 支持消息

timestring

The time the response was generated | 生成响应的时间

time_stampinteger

The timestamp the response was generated | 生成响应的时间戳

time_zonestring

The timezone of the response time | 响应时间的时区

docsstring nullable

Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接

cache_messagestring nullable

Cache message (EN-US) | 缓存消息 (English)

cache_message_zhstring nullable

Cache message (ZH-CN) | 缓存消息 (中文)

cache_urlstring nullable

The URL to access the cached result | 访问缓存结果的 URL

routerstring

The endpoint that generated this response | 生成此响应的端点

paramsunknown
dataunknown

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • warning

      changed the pattern of the request property from ^gh_[A-Za-z0-9_]+$ to ^[0-9A-Za-z][-_0-9A-Za-z]{1,63}(@[0-9A-Za-z]{1,16})?$

    • info

      the request property's maxLength was increased from 64 to 80