Home  >  Article  >  Backend Development  >  javascript - After WeChat uploads the picture, the picture reply message fails to execute

javascript - After WeChat uploads the picture, the picture reply message fails to execute

WBOY
WBOYOriginal
2016-08-18 09:16:041502browse

Recently, we were studying the WeChat public platform and found a particularly strange problem: whenever we run the WeChat upload picture interface (here I need to get the media_id) and then execute the WeChat message reply interface (sending pictures with media_id), it will fail.
Also, the media_id is required to reply to Mao’s WeChat picture message. Is it not possible to directly link the remote picture?

I searched some information on the Internet and found that it may be caused by timeout. After testing later, I feel that this situation should be ruled out. WeChat has too many pitfalls and no errCode is returned

Reply content:

Recently, we were studying the WeChat public platform and found a particularly strange problem: whenever we run the WeChat upload picture interface (here I need to get the media_id) and then execute the WeChat message reply interface (sending pictures with media_id), it will fail.
Also, the media_id is required to reply to Mao’s WeChat picture message. Is it not possible to directly link the remote picture?

I searched some information on the Internet and found that it may be caused by timeout. After testing later, I feel that this situation should be ruled out. WeChat has too many pitfalls and no errCode is returned

Generating media_id is actually a good idea. If you are on the side of WeChat development, you will find this benefit.
I can’t understand the description and can’t answer. There are many types of message reply methods and many pictures. For example, if you generate a If you want to send a QR code message to the user, you must first obtain the media_id by uploading the permanent material and then display it

You’d better read the documentation carefully first.
The media_id you get after calling the WeChat upload interface to upload a picture is temporary. The picture is saved on WeChat's server at this time. If you need this picture in your business, you have to call WeChat's media file download interface in the background in time (backend Call), use the media_id to download the real picture and save it on your own server, and then use the corresponding URL on your own server to view the picture when sending information.

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