Customer Service Messages
Back

From WeChat Official Account Admin Platform
Jump to: navigation, search

When a WeChat user sends a message to an Official Account, the WeChat Official Account Admin Platform issues HTTP POST requests with the XML data to the URL provided by the developer. The developer can then POST a JSON packet to the user unlimited times by calling this pushing message API within a given period, which is currently 48 hours. Use this API to send non-auto reply messages for customer services.

Request Description

HTTP request method: POST
https://api.wechat.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN


Contents

Text Message

{
   "touser":"OPENID",
   "msgtype":"text",
   "text":
   {
        "content":"Hello World"
   }
}
Parameter Required Description
access_token Yes The certificate for calling the API
touser Yes User's OpenID
msgtype Yes Text
content Yes Message content


Image Message

{
    "touser":"OPENID",
    "msgtype":"image",
    "image":
    {
      "media_id":"MEDIA_ID"
    }
}
Parameter Required Description
access_token Yes The certificate for calling the API
touser Yes User's OpenID
msgtype Yes Image
media_id Yes The media ID of the sending image


Audio Message

{
   "touser":"OPENID",
   "msgtype":"voice",
   "voice":
   {
     "media_id":"MEDIA_ID"
   }
}
Parameter Required Description
access_token Yes The certificate for calling the API
touser Yes User's OpenID
msgtype Yes Voice
media_id Yes The media ID of the sending audio


Video Message

{
   "touser":"OPENID",
   "msgtype":"video",
   "video":
   {
     "media_id":"MEDIA_ID",
     "thumb_media_id":"THUMB_MEDIA_ID"
   }
}
Parameter Required Description
access_token Yes The certificate for calling the API
touser Yes User's OpenID
msgtype Yes Video
media_id Yes The media ID of the sending video
thumb_media_id Yes The media ID of the video thumb


Music Message

{
   "touser":"OPENID",
   "msgtype":"music",
   "music":
   {
     "title":"MUSIC_TITLE",
     "description":"MUSIC_DESCRIPTION",
     "musicurl":"MUSIC_URL",
     "hqmusicurl":"HQ_MUSIC_URL",
     "thumb_media_id":"THUMB_MEDIA_ID" 
   }
}
Parameter Required Description
access_token Yes The certificate for calling the API
touser Yes User's OpenID
msgtype Yes Music
title No Music title
description No Music description
musicurl Yes Music URL
hqmusicurl Yes High-quality URL that WeChat accesses on WiFi
thumb_media_id Yes The media ID of the video thumb


Rich Media Message

The quantity of rich media message should be less than 10, or the server will not respond.

{
   "touser":"OPENID",
   "msgtype":"news",
   "news":{
       "articles": [
        {
            "title":"Happy Day",
            "description":"Is Really A Happy Day",
            "url":"URL",
            "picurl":"PIC_URL"
        },
        {
            "title":"Happy Day",
            "description":"Is Really A Happy Day",
            "url":"URL",
            "picurl":"PIC_URL"
        }
        ]
   }
}
Parameter Required Description
access_token Yes The certificate for calling the API
touser Yes User's OpenID
msgtype Yes News
title No Title of the rich media message
description No Description of the rich media message
url No Redirection link of the rich media message
picurl No URL of images in rich media messages. Recommended image size: 640*320 (large image); 80*80 (small image) Image format supported: JPG and PNG
Developer Guide
Custom-defined Menu
WeChat JS-SDK