没有不值得去解决的问题,也没有不值得去学习的技术!

Implementing the Hidden “Read Original” Link When Calling the API to Add Permanent Rich Text Media to a WeChat Official Account

In the WeChat Official Account backend, when creating a graphic message without checking the original link option, the field sourceurl0 is empty.

1. In the API documentation for adding permanent graphic materials to a WeChat Official Account, the field content_source_url is required. It specifies the original URL of the graphic message, which is the URL opened when clicking “Read Original”. See Figure 1.

In the API documentation for adding permanent graphic materials to a WeChat Official Account, the field content_source_url is required. It specifies the original URL of the graphic message, which is the URL opened when clicking "Read Original".
Figure 1

2. In the WeChat Official Account backend, when creating a graphic message without checking the original link option, the field sourceurl0 is empty. See Figure 2.

In the WeChat Official Account backend, when creating a graphic message without checking the original link option, the field sourceurl0 is empty.
Figure 2

3. In the WeChat Official Account backend, when creating a graphic message and checking the original link option, the value of the field sourceurl0 is the entered original link. See Figure 3.

In the WeChat Official Account backend, when creating a graphic message and checking the original link option, the value of the field sourceurl0 is the entered original link.
Figure 3

4. I ultimately decided to allow the field content_source_url to equal an empty string when calling the API to add permanent graphic materials. When set to an empty string, the call succeeds. Then I called the API to mass-send by tag [available for both subscription and service accounts after verification]. The publication was ultimately successful. The article did not display the “Read Original” link, as expected. See Figure 4.

I ultimately decided to allow the field content_source_url to equal an empty string when calling the API to add permanent graphic materials. When set to an empty string, the call succeeds. Then I called the API to mass-send by tag [available for both subscription and service accounts after verification]. The publication was ultimately successful. The article did not display the "Read Original" link, as expected.
Figure 4

5. When calling the API to add permanent graphic materials, the call still succeeds even if the field content_source_url does not exist.

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系