### Successful Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/base/api_getapidomainip This example demonstrates a successful response from the Get API Domain IP interface, returning a list of IP addresses. ```json { "ip_list": [ "101.89.47.18", "101.91.34.103" ] } ``` -------------------------------- ### First Request to Get Followers List Source: https://developers.weixin.qq.com/doc/subscription/api/usermanage/userinfo/api_getfans Example of the initial request to fetch the followers list. The `next_openid` parameter is omitted to start from the beginning. ```http https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN ``` -------------------------------- ### Get Video Material Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/material/permanent/api_getmaterial Example JSON response when successfully retrieving video material details. This includes title, description, and download URL. ```json { "title":TITLE, "description":DESCRIPTION, "down_url":DOWN_URL, } ``` -------------------------------- ### Get API Menu Info Example Source: https://developers.weixin.qq.com/doc/subscription/api/custommenu/api_getcurrentselfmenuinfo This example shows the response structure for API-based custom menu information. It includes 'click' type buttons with keys and 'view' type buttons with URLs. ```json { "is_menu_open": 1, "selfmenu_info": { "button": [ { "type": "click", "name": "今日歌曲", "key": "V1001_TODAY_MUSIC" }, { "name": "菜单", "sub_button": { "list": [ { "type": "view", "name": "搜索", "url": "http://www.soso.com/" }, { "type": "view", "name": "视频", "url": "http://v.qq.com/" }, { "type": "click", "name": "赞一下我们", "key": "V1001_GOOD" } ] } } ] } } ``` -------------------------------- ### HTTPS Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/customer/messctrl/api_getkfsessionlist This is an example of how to make an HTTPS GET request to retrieve the session list. Ensure you replace ACCESS_TOKEN and KFACCOUNT with valid credentials. ```http GET https://api.weixin.qq.com/customservice/kfsession/getsessionlist?access_token=ACCESS_TOKEN&kf_account=test1@test ``` ```http https://api.weixin.qq.com/customservice/kfsession/getsessionlist?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT ``` -------------------------------- ### Cloud Call Example Source: https://developers.weixin.qq.com/doc/subscription/api/material/temporary/api_getmedia This demonstrates how to call the media get function using the officialAccount.media.get method in a cloud environment. Input and output parameters are the same as for HTTPS calls. ```javascript officialAccount.media.get ``` -------------------------------- ### Get News Material Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/material/permanent/api_getmaterial Example JSON response when successfully retrieving news material details. This includes an array of news items. ```json { "news_item": [ { "title": "TITLE", "thumb_media_id": "THUMB_MEDIA_ID", "show_cover_pic": 1, "author": "AUTHOR", "digest": "DIGEST", "content": "CONTENT", "url": "URL", "content_source_url": "CONTENT_SOURCE_URL" } ] } ``` -------------------------------- ### HTTPS Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/wedata/news/api_getarticleshare This is an example of a successful response from the Get Article Share API. ```json { "list": [ { "ref_date": "2025-11-01", "msgid": "2247490098_1", "detail": { "share_user": 366 } } ], "is_delay": "false" } ``` -------------------------------- ### Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/openpoc/ai/api_addvoicetorecofortext Example of how to construct the request URL for the addVoiceTorecoForText API. Note that the format parameter is required. ```http https://api.weixin.qq.com/cgi-bin/media/voice/addvoicetorecofortext?access_token=ACCESS_TOKEN&format=&voice_id=xxxxxx&lang=zh_CN ``` -------------------------------- ### HTTPS Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/customer/messctrl/api_getkfsession This is an example of how to make an HTTPS GET request to retrieve the customer session status. Ensure you replace ACCESS_TOKEN and OPENID with valid values. ```http GET https://api.weixin.qq.com/customservice/kfsession/getsession?access_token=ACCESS_TOKEN&openid=OPENID ``` -------------------------------- ### Get Official Account Menu Info Example Source: https://developers.weixin.qq.com/doc/subscription/api/custommenu/api_getcurrentselfmenuinfo This example demonstrates the structure of the response when retrieving the current custom menu information for an official account. It shows various button types including view, news, video, and voice. ```json { "is_menu_open": 1, "selfmenu_info": { "button": [ { "name": "button", "sub_button": { "list": [ { "type": "view", "name": "view_url", "url": "http://www.qq.com" }, { "type": "news", "name": "news", "value":"KQb_w_Tiz-nSdVLoTV35Psmty8hGBulGhEdbb9SKs-o", "news_info": { "list": [ { "title": "MULTI_NEWS", "author": "JIMZHENG", "digest": "text", "show_cover": 0, "cover_url": "http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfK0HKuBIa1A1cypS0uY1wickv70iaY1gf3I1DTszuJoS3lAVLvhTcm9sDA/0", "content_url": "http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=1&sn=80ce6d9abcb832237bf86c87e50fda15#rd", "source_url": "" }, { "title": "MULTI_NEWS1", "author": "JIMZHENG", "digest": "MULTI_NEWS1", "show_cover": 1, "cover_url": "http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfKnmnpXYgWmQD5gXUrEApIYBCgvh2yHsu3ic3anDUGtUCHwjiaEC5bicd7A/0", "content_url": "http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=2&sn=8226843afb14ecdecb08d9ce46bc1d37#rd", "source_url": "" } ] } }, { "type": "video", "name": "video", "value": "http://61.182.130.30/vweixinp.tc.qq.com/1007_114bcede9a2244eeb5ab7f76d951df5f.f10.mp4?vkey=77A42D0C2015FBB0A3653D29C571B5F4BBF1D243FBEF17F09C24FF1F2F22E30881BD350E360BC53F&sha=0&save=1" }, { "type": "voice", "name": "voice", "value": "nTXe3aghlQ4XYHa0AQPWiQQbFW9RVtaYTLPC1PCQx11qc9UB6CiUPFjdkeEtJicn" } ] } }, { "type": "text", "name": "text", "value": "This is text!" }, { "type": "img", "name": "photo", "value": "ax5Whs5dsoomJLEppAvftBUuH7CgXCZGFbFJifmbUjnQk_ierMHY99Y5d2Cv14RD" } ] } } ``` -------------------------------- ### HTTPS Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/customer/servicermanage/api_getonlinekflist This is an example of how to make an HTTPS GET request to the getonlinekflist API. Ensure you replace ACCESS_TOKEN and BUSINESS_ID with valid values. BUSINESS_ID is optional for regular mini-program customer service. ```http GET https://api.weixin.qq.com/cgi-bin/customservice/getonlinekflist?access_token=ACCESS_TOKEN&business_id=BUSINESS_ID ``` -------------------------------- ### Request Example for Draft Count Source: https://developers.weixin.qq.com/doc/subscription/api/draftbox/draftmanage/api_draft_count Example of a GET request to the draft count API. ```HTTP https://api.weixin.qq.com/cgi-bin/draft/count ``` -------------------------------- ### Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/notify/autoreplies/api_getcurrentautoreplyinfo This example demonstrates the structure of a successful response, detailing the status and content of different autoreply configurations. ```json { "is_add_friend_reply_open": 1, "is_autoreply_open": 1, "add_friend_autoreply_info": { "type": "text", "content": "Thanks for your attention!" }, "message_default_autoreply_info": { "type": "text", "content": "Hello, this is autoreply!" }, "keyword_autoreply_info": { "list": [ { "rule_name": "autoreply-news", "create_time": 1423028166, "reply_mode": "reply_all", "keyword_list_info": [ { "type": "text", "match_mode": "contain", "content": "news测试" } ], "reply_list_info": [ { "type": "news", "news_info": { "list": [ { "title": "it's news", "author": "jim", "digest": "it's digest", "show_cover": 1, "cover_url": "http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfKbE8sWdt2DDcL0dMfQWJWTVn1N8DxI0gcRmrtqBOuwQH euPKmFLK0ZQ/0", "content_url": "http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=203929886&idx=1&sn=628f964cf0c6d84c026881b6959aea8b#rd", "source_url": "http://www.url.com" } ] } }, { "type": "news", "content":"KQb_w_Tiz-nSdVLoTV35Psmty8hGBulGhEdbb9SKs-o", "news_info": { "list": [ { "title": "MULTI_NEWS", "author": "JIMZHENG", "digest": "text", "show_cover": 0, "cover_url": "http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfK0HKuBIa1A1cypS0uY1wickv70iaY1gf3I1DTszuJoS3lAVLv hTcm9sDA/0", "content_url": "http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=1&sn=80ce6d9abcb832237bf86c87e50fda15#rd", "source_url": "" }, { "title": "MULTI_NEWS4", "author": "JIMZHENG", "digest": "MULTI_NEWSMULTI_NEWSMULTI_NEWSMULTI_NEWSMULTI_NEWSMULT", "show_cover": 1, "cover_url": "http://mmbiz.qpic.cn/mmbiz/GE7et87vE9vicuCibqXsX9GPPLuEtBfXfKbE8sWdt2DDcL0dMfQWJWTVn1N8DxI0gcRmrtqBOuwQ HeuPKmFLK0ZQ/0", "content_url": "http://mp.weixin.qq.com/s?__biz=MjM5ODUwNTM3Ng==&mid=204013432&idx=5&sn=b4ef73a915e7c2265e437096582774af#rd", "source_url": "" } ] } } ] }, { "rule_name": "autoreply-voice", "create_time": 1423027971, "reply_mode": "random_one", "keyword_list_info": [ { "type": "text", "match_mode": "contain", "content": "voice测试" } ], "reply_list_info": [ { "type": "voice", "content": "NESsxgHEvAcg3egJTtYj4uG1PTL6iPhratdWKDLAXYErhN6oEEfMdVyblWtBY5vp" } ] }, { "rule_name": "autoreply-text", "create_time": 1423027926, "reply_mode": "random_one", "keyword_list_info": [ { "type": "text", "match_mode": "contain", "content": "text测试" } ], "reply_list_info": [ { "type": "text", "content": "hello!text!" } ] }, { "rule_name": "autoreply-video", "create_time": 1423027801, "reply_mode": "random_one", "keyword_list_info": [ { "type": "text", "match_mode": "equal", "content": "video测试" } ] } ] } } ``` -------------------------------- ### HTTPS Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/usermanage/userinfo/api_userinfo This is an example of an HTTPS GET request to retrieve user information. Ensure you replace ACCESS_TOKEN and the openid with valid values. The lang parameter is optional. ```http GET https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=o6_bmjrPTlm6_2sgVt7hMZOPfL2M&lang=zh_CN ``` -------------------------------- ### HTTPS Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/stores/miniapp/api_getwxastoreauditinfo This is an example of how to make an HTTPS GET request to the API endpoint. Ensure you replace ACCESS_TOKEN with a valid token. ```http GET https://api.weixin.qq.com/wxa/get_merchant_audit_info?access_token=ACCESS_TOKEN ``` -------------------------------- ### Batch Get Material (News) Source: https://developers.weixin.qq.com/doc/subscription/api/material/permanent/api_batchgetmaterial This example demonstrates how to retrieve a list of news materials. You can specify the type, offset, and count of materials to fetch. ```APIDOC ## POST https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=ACCESS_TOKEN ### Description Retrieves a list of permanent materials of a specified type. ### Method POST ### Endpoint https://api.weixin.qq.com/cgi-bin/material/batchget_material ### Parameters #### Query Parameters - **access_token** (string) - Required - The access token for API invocation. #### Request Body - **type** (string) - Required - The type of material to retrieve (image, video, voice, news). - **offset** (number) - Required - The offset from the beginning of the material list. - **count** (number) - Required - The number of materials to retrieve (between 1 and 20). ### Request Example ```json { "type": "news", "offset": 0, "count": 20 } ``` ### Response #### Success Response (200) - **total_count** (number) - The total number of materials of the specified type. - **item_count** (number) - The number of materials returned in this request. - **item** (objarray) - An array of material objects. - **media_id** (string) - The ID of the material. - **content** (object) - The content of the material (for news items). - **news_item** (objarray) - An array of news articles within the material. - **title** (string) - The title of the news article. - **thumb_media_id** (string) - The media ID of the cover image. - **show_cover_pic** (number) - Whether to show the cover picture (0 for false, 1 for true). - **author** (string) - The author of the news article. - **digest** (string) - The summary of the news article. - **content** (string) - The detailed content of the news article (supports HTML, less than 20k characters, less than 1M, JS removed). - **url** (string) - The URL of the news article page. - **content_source_url** (string) - The original URL of the news article. - **update_time** (number) - The update time of the material. - **name** (string) - The name of the material (for image, voice, video). - **url** (string) - The URL of the material (for image, voice, video). ### Response Example ```json { "total_count": 100, "item_count": 20, "item": [ { "media_id": "MEDIA_ID", "content": { "news_item": [ { "title": "TITLE", "thumb_media_id": "THUMB_MEDIA_ID", "show_cover_pic": 1, "author": "AUTHOR", "digest": "DIGEST", "content": "CONTENT", "url": "URL", "content_source_url": "CONTENT_SOURCE_URL" } ] }, "update_time": 1620000000 } ] } ``` ``` -------------------------------- ### Batch Get Material (Image) Source: https://developers.weixin.qq.com/doc/subscription/api/material/permanent/api_batchgetmaterial This example shows how to retrieve a list of image materials. Similar to news materials, you can specify the type, offset, and count. ```APIDOC ## POST https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=ACCESS_TOKEN ### Description Retrieves a list of permanent materials of a specified type. ### Method POST ### Endpoint https://api.weixin.qq.com/cgi-bin/material/batchget_material ### Parameters #### Query Parameters - **access_token** (string) - Required - The access token for API invocation. #### Request Body - **type** (string) - Required - The type of material to retrieve (image, video, voice, news). - **offset** (number) - Required - The offset from the beginning of the material list. - **count** (number) - Required - The number of materials to retrieve (between 1 and 20). ### Request Example ```json { "type": "image", "offset": 0, "count": 10 } ``` ### Response #### Success Response (200) - **total_count** (number) - The total number of materials of the specified type. - **item_count** (number) - The number of materials returned in this request. - **item** (objarray) - An array of material objects. - **media_id** (string) - The ID of the material. - **name** (string) - The name of the material (for image, voice, video). - **update_time** (number) - The update time of the material. - **url** (string) - The URL of the material (for image, voice, video). ### Response Example ```json { "total_count": 50, "item_count": 10, "item": [ { "media_id": "MEDIA_ID", "name": "IMAGE.jpg", "update_time": 1620000000, "url": "http://mmbiz.qpic.cn/xxx" } ] } ``` ``` -------------------------------- ### Example Request URL for wx_card Ticket Source: https://developers.weixin.qq.com/doc/subscription/api/webdev/js/api_getticket This example shows the URL structure for requesting a ticket of type 'wx_card'. ```http https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=wx_card ``` -------------------------------- ### Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/openpoc/ai/api_queryrecoresultfortext This is an example of a successful response from the queryRecoResultForText API, containing the recognized text. ```json { "result": "xxxxxxxxxxxxxxxxxx" } ``` -------------------------------- ### Successful Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/material/temporary/api_gethdvoice A successful response to the Get HD Voice API request will return the raw file buffer of the audio data. ```Text file buffer ``` -------------------------------- ### Response Payload for Get Draft (Image Article) Source: https://developers.weixin.qq.com/doc/subscription/api/draftbox/draftmanage/api_getdraft This example demonstrates the response structure for an image article, including image_info and product_info. ```json { "article_type":"newspic", "title":TITLE, "content":CONTENT, "thumb_media_id":THUMB_MEDIA_ID, "need_open_comment":0, "only_fans_can_comment":0, "image_info":{ "image_list":[ { "image_media_id":IMAGE_MEDIA_ID } ] }, "product_info": { "footer_product_info": { "product_key":PRODUCT_KEY } }, "url":URL } ] } ``` -------------------------------- ### Get Stable Access Token (Force Refresh Mode) Source: https://developers.weixin.qq.com/doc/subscription/api/base/api_getstableaccesstoken This example demonstrates how to use the force refresh mode to obtain a new access token, invalidating the previously issued one. Use this mode with caution as it has daily limits and requires a minimum interval between calls. ```APIDOC ## POST /cgi-bin/stable_token (Force Refresh) ### Description Obtains a new stable access token by forcing a refresh, invalidating the previous token. This mode is intended for specific scenarios and has usage limitations. ### Method POST ### Endpoint https://api.weixin.qq.com/cgi-bin/stable_token ### Parameters #### Query Parameters None #### Request Body - **grant_type** (string) - Required - Must be 'client_credential'. - **appid** (string) - Required - The unique identifier for the account (AppID). - **secret** (string) - Required - The unique credential secret (AppSecret). - **force_refresh** (boolean) - Required - Set to `true` to enable force refresh mode. ### Request Example ```json { "grant_type": "client_credential", "appid": "APPID", "secret": "APPSECRET", "force_refresh": true } ``` ### Response #### Success Response (200) - **access_token** (string) - The newly obtained credential. - **expires_in** (number) - The validity period of the credential in seconds (currently within 7200 seconds). #### Response Example ```json { "access_token":"ACCESS_TOKEN", "expires_in":7200 } ``` ``` -------------------------------- ### Response Payload for Get Store List Source: https://developers.weixin.qq.com/doc/subscription/api/stores/miniapp/api_newgetpoilist This is an example of a successful response from the newgetpoilist API, containing store details and total count. Note the structure of the business_list and photo_list objects. ```json { "errcode": 0, "errmsg": "ok", "business_list": [ { "base_info": { "business_name": "超速天使俱乐部", "address": "新华路19", "telephone": "12345678", "categories": [], "city": "邯郸市", "province": "河北省", "longitude": 114.958480835, "latitude": 36.7714881897, "photo_list": [ { "photo_url": "http://mmbiz.qpic.cn/mmbiz_jpg/tW66AWvE2K4e52sLYyA90ZKuicdfhkf5ibQk1icmcRWjrMxmVibo8sVQAllABxG5ic0D5x62gfsPVL4aibxQ2SicfPyjQ/0?wx_fmt=jpeg" } ], "open_time": "10:00-21:00", "poi_id": "472665875", "status": 1, "district": "曲周县", "qualification_list": [], "qualification_num": "01650100NE2XCT6Z70", "qualification_name": "超速天使俱乐部" } }, { "base_info": { "business_name": "龙涤小区熟食店", "address": "舍利街道中都大道龙涤小区阿升电脑旁", "telephone": "12345678", "categories": [], "city": "哈尔滨市", "province": "黑龙江省", "longitude": 126.94355011, "latitude": 45.556098938, "photo_list": [ { "photo_url": "http://mmbiz.qpic.cn/mmbiz_png/tW66AWvE2K6icjle1q6nbfKr0HMibzxKqOUfG1hARktHV84ZZojt9cXZ0UicDevZQUicckPw68lfo2Le3RjpEo6oLg/0?wx_fmt=png" } ], "open_time": "11:00-12:00", "poi_id": "472671857", "status": 3, "district": "阿城区", "qualification_list": [], "qualification_num": "91750100ME2XCR6A70", "qualification_name": "龙涤小区熟食店" } } ], "total_count": 2 } ``` -------------------------------- ### HTTPS Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/usermanage/userinfo/api_getblacklist This is an example of an HTTPS request to retrieve the blacklist. Ensure you replace ACCESS_TOKEN with a valid token. ```http POST https://api.weixin.qq.com/cgi-bin/tags/members/getblacklist?access_token=ACCESS_TOKEN ``` -------------------------------- ### Example Response for Store Mini Program Categories Source: https://developers.weixin.qq.com/doc/subscription/api/stores/miniapp/api_getwxastorecatelist This example demonstrates the structure of a successful response from the `getwxastorecatelist` API. It includes category information, such as IDs, names, levels, and potential qualification requirements for specific categories. ```json { "errcode": 0, "errmsg": "ok", "data": { "all_category_info": { "categories": [ { "id": 0, "name": "root", "level": 0, "children": [ 269, 278 ] }, { "id": 278, "name": "购物", "level": 1, "father": 0, "children": [ 279, 280 ] }, { "id": 280, "name": "便利店", "level": 2, "father": 278, "children": [], "qualify": { "exter_list": [ { "inner_list": [ { "name": "若涉及食品,请提供《食品经营许可证》或《卫生许可证》" } ] } ] }, "scene": 3, "sensitive_type": 1 } ] } } } ``` -------------------------------- ### HTTPS Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/stores/miniapp/api_getdistrictlist This is an example of an HTTPS GET request to the Get District List API. Ensure you replace ACCESS_TOKEN with a valid token. ```http GET https://api.weixin.qq.com/wxa/get_district?access_token=ACCESS_TOKEN ``` -------------------------------- ### Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/customer/messctrl/api_getkfsession This is an example of a successful response from the getkfsession API, indicating the session's creation time and the assigned customer service account. ```json { "createtime": 123456789, "kf_account": "test1@test" } ``` -------------------------------- ### Get District List API Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/stores/miniapp/api_getdistrictlist This example shows the structure of a successful response from the Get District List API, including status, message, data version, and the hierarchical district data. ```json { "status": 0, "message": "query ok", "data_version": "20170510", "result": [ [{ "id": "440000", "name": "广东", "fullname": "广东省", "pinyin": [ "guang", "dong"], "location": { "lat": 23.13171, "lng": 113.26627 }, "cidx": [246,266] }], [{ "id": "440100", "name": "广州", "fullname": "广州市", "pinyin": [ "guang","zhou" ], "location": { "lat": 23.12908, "lng": 113.26436 }, "cidx": [1667,1677] }], [{ "id": "440105", "fullname": "海珠区", "location": { "lat": 23.08331, "lng": 113.3172 } },{ "id": "440106", "fullname": "天河区", "location": { "lat": 23.12463, "lng": 113.36199 } }] ] } ``` -------------------------------- ### Response Example for Get Group Sending Speed Source: https://developers.weixin.qq.com/doc/subscription/api/notify/message/api_getspeed This is an example of a successful response from the Get Group Sending Speed API, indicating the speed level and the actual sending rate in millions per minute. ```json { "speed":3, "realspeed":15 } ``` -------------------------------- ### API Set Menu Example Source: https://developers.weixin.qq.com/doc/subscription/api/custommenu/api_getcurrentselfmenuinfo Provides an example of how to set the custom menu for an official account using the API. ```APIDOC ## POST /cgi-bin/menu/create ### Description Sets the custom menu for the official account. This endpoint allows for the creation of complex menus with various button types, including view, click, text, and image, as well as nested sub-menus. ### Method POST ### Endpoint /cgi-bin/menu/create ### Request Body - **button** (array) - Required - An array of menu button objects. - **name** (string) - Required - The name of the button (max 4 characters). - **type** (string) - Required - The type of the button. Possible values: 'click', 'view', 'scancode_push', 'scancode_waitmsg', 'pic_sysphoto', 'pic_photo_or_album', 'pic_weixin', 'location_select', 'media_id', 'view_limited'. - **url** (string) - Required if type is 'view' - The URL to be opened when the button is clicked. - **key** (string) - Required if type is 'click', 'scancode_push', 'scancode_waitmsg', 'pic_sysphoto', 'pic_photo_or_album', 'pic_weixin', 'location_select' - The key value associated with the button. - **sub_button** (object) - Optional - An object containing sub-buttons for a parent menu. - **list** (array) - Required if 'sub_button' is present - An array of sub-button objects, following the same structure as the main buttons. ### Request Example ```json { "button": [ { "type": "click", "name": "今日歌曲", "key": "V1001_TODAY_MUSIC" }, { "name": "菜单", "sub_button": { "list": [ { "type": "view", "name": "搜索", "url": "http://www.soso.com/" }, { "type": "view", "name": "视频", "url": "http://v.qq.com/" }, { "type": "click", "name": "赞一下我们", "key": "V1001_GOOD" } ] } } ] } ``` ### Response #### Success Response (200) - **errcode** (integer) - Error code, 0 for success. - **errmsg** (string) - Error message, 'ok' for success. #### Response Example ```json { "errcode": 0, "errmsg": "ok" } ``` ``` -------------------------------- ### HTTPS Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/wedata/news/api_getarticleshare This is an example of the request payload for the Get Article Share API using HTTPS. ```json { "begin_date": "2025-11-01", "end_date": "2025-11-01" } ``` -------------------------------- ### Response Payload Example Source: https://developers.weixin.qq.com/doc/subscription/api/wedata/news/api_getusersharehour Example JSON response from the Get User Share Hour API, showing hourly share data. ```json { "list": [ { "ref_date": "2014-12-07", "ref_hour": 1200, "share_scene": 1, "share_count": 72, "share_user": 4 } ] } ``` -------------------------------- ### Example Response for Default Menu Source: https://developers.weixin.qq.com/doc/subscription/api/custommenu/api_getmenu This is an example of the JSON response when querying for the default menu configuration. It includes the structure of the default buttons. ```json { "menu": { "button": [ { "type": "click", "name": "今日歌曲", "key": "V1001_TODAY_MUSIC", "sub_button": [] } ] } } ``` -------------------------------- ### Request Payload Example Source: https://developers.weixin.qq.com/doc/subscription/api/wedata/news/api_getusersharehour Example JSON payload for the Get User Share Hour API request, specifying the date range. ```json { "begin_date": "2014-12-08", "end_date": "2014-12-08" } ``` -------------------------------- ### Response Payload Example Source: https://developers.weixin.qq.com/doc/subscription/api/customer/message/api_getmsglist This example shows the structure of a successful response from the Get Message List API, including the list of message records. ```json { "recordlist": [ { "openid": "oDF3iY9WMaswOPWjCIp_f3Bnpljk", "opercode": 2002, "text": "您好,客服test1为您服务。", "time": 1464710500, "worker": "test1@test" } ], "number": 10000, "msgid": 20165258 } ``` -------------------------------- ### Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/usermanage/tag/api_gettags This example shows the structure of the response when successfully retrieving tags. It includes tag ID, name, and the number of followers for each tag. ```json { "tags": [ { "id": 1, "name": "每天一罐可乐星人", "count": 0 }, { "id": 2, "name": "星标组", "count": 0 } ] } ``` -------------------------------- ### Request Payload Example Source: https://developers.weixin.qq.com/doc/subscription/api/wedata/mess/api_getupstreammsg This is an example of the JSON payload required for the Get Upstream Message API request. Specify the begin_date and end_date for the data query. ```json { "begin_date": "2014-12-07", "end_date": "2014-12-08" } ``` -------------------------------- ### cURL Example for Uploading Head Image Source: https://developers.weixin.qq.com/doc/subscription/api/customer/servicermanage/api_uploadkfheadimg This example demonstrates how to use cURL to upload a head image for a customer service account. The `media` parameter should be a file path prefixed with `@`, and `ACCESS_TOKEN` and `KFACCOUNT` need to be replaced with actual values. ```curl curl -F media=@test.jpg "https://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT" ``` -------------------------------- ### GetKfList API Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/customer/servicermanage/api_getkflist This example shows the structure of a successful response from the GetKfList API, detailing the customer service list with their respective information. ```json { "kf_online_list" : [ { "kf_account" : "", "kf_headimgurl" : "http://mmbiz.qpic.cn/mmbiz/4whpV1VZl2iccsvYbHvnphkyGtnvjfUS8Ym0GSaLic0FD3vN0V8PILcibEGb2fPfEOmw/0", "kf_id" : "1001", "kf_nick" : "ntest1", "kf_wx" : "kfwx1", "kf_openid": "kfopenid1" }, { "kf_account" : "test1@test" , "status" : 1, "kf_id" : "1001" , "accepted_case" : 1 }, { "kf_account" :"test2@test" , "status" : 1, "kf_id" :"1002" , "accepted_case" : 2 } ] } ``` -------------------------------- ### Example of a Miniprogram Menu Button Source: https://developers.weixin.qq.com/doc/subscription/api/custommenu/api_createcustommenu Illustrates how to configure a menu button that opens a specific page within a WeChat Mini Program. Ensure the 'appid' and 'pagepath' are correctly specified for miniprogram type buttons. ```json { "type": "miniprogram", "name": "wxa", "url": "http://mbd.fenqile.com/", "appid": "wx5826f26d97e50657", "pagepath": "pages/index/index" } ``` -------------------------------- ### Response Payload Example Source: https://developers.weixin.qq.com/doc/subscription/api/wedata/mess/api_getupstreammsg This is an example of the JSON response structure for the Get Upstream Message API. It includes a list of message statistics for the specified date range. ```json { "list": [ { "ref_date": "2014-12-07", "msg_type": 1, "msg_user": 282, "msg_count": 817 } ] } ``` -------------------------------- ### Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/openpoc/ai/api_addvoicetorecofortext Example of a successful response from the addVoiceTorecoForText API, indicating the operation was completed with an 'ok' message and error code '0'. ```json { "errmsg": "ok", "errcode": "0" } ``` -------------------------------- ### Create Store Mini Program Source: https://developers.weixin.qq.com/doc/subscription/api/stores/miniapp/api_applywxastore This API endpoint is used to create a store mini program. It requires server-side invocation and administrator confirmation. The process involves submitting details such as category IDs, media assets for the store's avatar and qualifications, nickname, and introduction. ```APIDOC ## POST https://api.weixin.qq.com/wxa/apply_merchant?access_token=ACCESS_TOKEN ### Description This API is used to create a store mini program. It requires server-side invocation and administrator confirmation. ### Method POST ### Endpoint https://api.weixin.qq.com/wxa/apply_merchant ### Parameters #### Query Parameters - **access_token** (string) - Required - Interface call credential, can use access_token or authorizer_access_token #### Request Body - **first_catid** (number) - Required - First-level category ID - **second_catid** (number) - Required - Second-level category ID - **headimg_mediaid** (string) - Required - Temporary media ID for the avatar (supports jpg and png formats) - **nickname** (string) - Required - Store mini program nickname (4-30 characters, Chinese characters count as two) - **intro** (string) - Required - Store mini program introduction - **qualification_list** (string) - Required - Category-related qualification, temporary media ID - **org_code** (string) - Optional - Business license or organization code certificate, temporary media ID - **other_files** (string) - Optional - Supplementary materials, temporary media ID ### Request Example ```json { "first_catid": 476, "second_catid": 477, "qualification_list": "RTZgKZ386yFn5kQSWLTxe4bqxwgzGBjs3OE02cg9CVQk1wRVE3c8fjUFX7jvpi-P", "headimg_mediaid": "RTZgKZ386yFn5kQSWLTxe4bqxwgzGBjs3OE02cg9CVQk1wRVE3c8fjUFX7jvpi-P", "nickname": "hardenzhang308", "intro": "hardenzhangtest", "org_code": "", "other_files": "" } ``` ### Response #### Success Response (200) - **errcode** (number) - Error code - **errmsg** (string) - Error description #### Response Example ```json { "errcode" : 0, "errmsg" : "ok" } ``` ``` -------------------------------- ### Get Blacklist Request Payload Source: https://developers.weixin.qq.com/doc/subscription/api/usermanage/userinfo/api_getblacklist This JSON payload is used to request the blacklist. Specify 'begin_openid' to start fetching from a particular OpenID, or leave it empty to start from the beginning. ```json { "begin_openid": "OPENID1" } ``` -------------------------------- ### Request Example for Get Group Sending Speed Source: https://developers.weixin.qq.com/doc/subscription/api/notify/message/api_getspeed This example shows the JSON payload for requesting the group sending speed. Note that the actual request body is empty, and 'speed' is a query parameter in the URL. ```json { "speed":3 } ``` -------------------------------- ### File Upload Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/openpoc/ocr/api_drivingocr This example demonstrates how to upload a file for OCR recognition using a cURL command. The 'img' parameter should be followed by '@' and the file path. ```Shell curl -F 'img=@test.jpg' "https://api.weixin.qq.com/cv/ocr/driving?access_token=ACCESS_TOCKEN" ``` -------------------------------- ### Example of an Article Menu Button Source: https://developers.weixin.qq.com/doc/subscription/api/custommenu/api_createcustommenu Shows how to create a menu button that displays a specific article as a card. This is useful for linking to content published through WeChat's article management system. ```json { "type": "article_id", "name": "图文消息", "article_id": "q1234567890abcdefg" } ``` -------------------------------- ### Response Example Source: https://developers.weixin.qq.com/doc/subscription/api/customer/messctrl/api_getkfsessionlist This is an example of the JSON response structure when successfully retrieving a list of customer service sessions. The sessionlist array contains details for each active session. ```json { "sessionlist": [ { "createtime": 123456789, "openid": "OPENID" } ] } ``` -------------------------------- ### Request Payload Example Source: https://developers.weixin.qq.com/doc/subscription/api/wedata/api/api_getinterfacesummaryhour This JSON object represents the request payload for the Get Interface Summary Hour API. It specifies the date range for which to retrieve data. ```json { "begin_date": "2014-12-01", "end_date": "2014-12-01" } ``` -------------------------------- ### Upload via URL Request Example Source: https://developers.weixin.qq.com/doc/subscription/api/openpoc/ocr/api_bizlicenseocr Use this cURL command to send a request to the OCR Business License API by providing an image URL. Ensure the URL is properly encoded and you have a valid access token. ```bash curl "https://api.weixin.qq.com/cv/ocr/bizlicense?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN" ``` -------------------------------- ### Example Response for Get Ticket API Source: https://developers.weixin.qq.com/doc/subscription/api/webdev/js/api_getticket This is a sample JSON response when the getTicket API call is successful. It includes the ticket, its expiration time, and status codes. ```json { "errcode":0, "errmsg":"ok", "ticket":"bxLdikRXVbTPdHSM05e5u5sUoXNKdvsdshFKA", "expires_in":7200 } ``` -------------------------------- ### Response Payload for Get Draft (News Article) Source: https://developers.weixin.qq.com/doc/subscription/api/draftbox/draftmanage/api_getdraft The response includes a news_item array containing details of the draft. This example shows the structure for a news article. ```json { "news_item": [ { "article_type":"news", "title":TITLE, "author":AUTHOR, "digest":DIGEST, "content":CONTENT, "content_source_url":CONTENT_SOURCE_URL, "thumb_media_id":THUMB_MEDIA_ID, "show_cover_pic":0, "need_open_comment":0, "only_fans_can_comment":0, "url":URL } ``` -------------------------------- ### cURL Request to Upload File for Image Cropping Source: https://developers.weixin.qq.com/doc/subscription/api/openpoc/image/api_imgaicrop This example demonstrates how to use cURL to upload a local image file (test.jpg) and specify aspect ratios for intelligent cropping. Replace ACCESS_TOCKEN with your valid token. ```bash curl -F 'img=@test.jpg' -F 'ratios=1,2.35' 'http://api.weixin.qq.com/cv/img/aicrop?access_token=ACCESS_TOCKEN' ```