Enterprise public number after upgrading to enterprise WeChat the reason for sending a message failed

Source: Internet
Author: User
Recently, saw the news, said is the enterprise public number to upgrade to the enterprise. At that time did not care, but later found that the enterprise public interface to send a notification message program can not send out the message. This article will share with you the enterprise public number after the upgrade to the enterprise to send message failure reasons and solutions.

Login to the new background to see the secret value of the application has changed, compared to the previous number of bits less. After you replace the secret value in your code with a new one, you find that it is still not working. Debug read the error when sending a message using the POST request interface: {"Errcode":-1, "errmsg": "Invalid Input"}. There could be two reasons for the analysis: the outgoing message interface address of the call is incorrect, or the post parameter passed is not in the correct format.

Fortunately, on its official web site found the Enterprise API documentation: HTTPS://WORK.WEIXIN.QQ.COM/API/DOC, the above has more detailed instructions for use. It has been confirmed that the URL address of the calling interface has not changed (sending a message or using Https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN). However, the text message is found to have a different format, the official website example is as follows:


{    "Touser": "userid1| userid2| UserID3 ",    " Toparty ":" partyid1| PartyID2 ",    " Totag ":" TagID1 | TagID2 ",    " Msgtype ":" Text ",    " Agentid ": 1,    " text ": {      " content ":" Your Courier has arrived, please bring cards to the mail center to pick up. " \ n <a href=\ "http://work.weixin.qq.com\" > Email Center video Live </a> Before you go, smart to avoid queuing. "    }}

Above the UserID, PartyId these should I used to be a numeric value, but the example is placed in quotation marks, that is to be treated as a string. So, I changed the code to a string of the way to try, the results can be ...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.