-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpException with uploadArticle API #544
Comments
plz post your code. |
$article = new \EasyWeChat\Message\Article([
|
get media id: $result = $material->uploadThumb("/path/to/your/thumb.jpg");
$mediaId = $result->media_id;
// {
// "media_id":MEDIA_ID,
// } and upload article: use EasyWeChat\Message\Article;
// 上传单篇图文
$article = new Article([
'title' => 'xxx',
'thumb_media_id' => $mediaId,
//...
]);
$material->uploadArticle($article); |
Yes media Id gotten from Material::uploadThumb(). $m = app('wechat')->material->uploadThumb($path); |
@djade007 it seems like that you missing the |
The title is there. |
@djade007 I'm sorry, I've tried my best. |
@overtrue, please can you try to test the Material::uploadArticle() from your end? |
yes, I've tried. |
You are right, there was a typo in the title, I was using 'tittle'. |
@djade007 💔💔💔💔💔💔💔 |
I would blame the wechat api, the error message wasn't helpful. I kept thinking it was the content field that was missing. Thanks for taking your time to help. |
@djade007 you are welcome. |
我用的环境
PHP 版本:7.0
overtrue/wechat 版本:3.1
问题及现象
I'm unable to use Material::uploadArticle(). I keep getting empty content error Exception.
##wechat logs
media_id gotten from Material::uploadThumb();
easywechat.DEBUG: Client Request: {"url":"https://api.weixin.qq.com/cgi-bin/material/add_news","method":"POST","options":{"timeout":5,"body":"{"articles":[{"thumb_media_id":"media_id","author":"TEST","digest":"This is the summary","show_cover_pic":1,"content":"This is a test content","content_source_url":"http://example.com"}]}","headers":{"content-type":"application/json"}}} []
[2016-12-13 22:52:46] easywechat.DEBUG: API response decoded: {"contents":{"errcode":44004,"errmsg":"empty content hint: [tlL0965e541]"}} []
The text was updated successfully, but these errors were encountered: