search
HomeWeChat AppletWeChat DevelopmentWeChat public platform development customer service interface to send customer service messages

When the user actively sends a message to the official account (including sending information, clicking the custom menu clike event, subscribing event, scanning QR code event, payment success event, user rights protection), WeChat will push the message data to Developers, developers can call the customer service message interface within a period of time (currently 24 hours) and send messages to ordinary users by POSTing a JSON data packet. There is no limit on the number of sending times within 24 hours. This interface is mainly used for functions such as customer service that require manual message processing, so that developers can provide users with better services.

1. Get ACCESS_TOKEN

http request method: GET
https://api.weixin.qq.com/cgi- bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET

Parameter Is it required Description
grant_type Yes Get access_token fill in client_credential
appid Yes Third party User's unique credential
secret is 's third-party user's unique credential key, which is appsecret

Under normal circumstances, WeChat will return the following JSON data packet to the public account:
{"access_token":"ACCESS_TOKEN","expires_in":7200}

2. Send a message

Send a text message

微信公众平台开发 客服接口发送客服消息

微信公众平台开发 客服接口发送客服消息

Send a picture (media_id needs to be uploaded first Picture obtained)

$img = '{
    "touser":"oLVPpjqs9BhvzwPj5A-vTYAX3GLc",
    "msgtype":"image",
    "image":
    {
      "media_id":"jViS8sQUXIh6rTdkz2qUOD5pvChYpp50i9rsLR4YnCm-pqdpiHhz6xbN2KAboScV"
    }
}';

微信公众平台开发 客服接口发送客服消息

The following is a screenshot of the customer service system developed using the customer interface

微信公众平台开发 客服接口发送客服消息

微信公众平台开发 客服接口发送客服消息微信公众平台开发 客服接口发送客服消息


####################################################################### net! ###
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!