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 ...