$obj = new \wechat\Wechat();
$obj->official()->draft()->create('{
"articles": [
{
"title": "标题",
"author": "作者",
"digest": "摘要",
"content": "内容",
"content_source_url": "原文地址",
"thumb_media_id": "缩略图素材ID",
"show_cover_pic": 1,
"need_open_comment": 0,
"only_fans_can_comment": 0
}
]
}');
成功结果:
草稿箱素材 = MEDIA_ID
参数:
string $media_id
使用示例:
$obj = new \wechat\Wechat();
$obj->official()->draft()->get('MEDIA_ID');
成功结果:
array(1) {
[0]=>
array(10) {
["title"]=>
string(6) "标题"
["author"]=>
string(6) "作者"
["digest"]=>
string(6) "摘要"
["content"]=>
string(6) "内容"
["content_source_url"]=>
string(12) "原文地址"
["thumb_media_id"]=>
string(17) "缩略图素材ID"
["show_cover_pic"]=>
int(1)
["need_open_comment"]=>
int(0)
["only_fans_can_comment"]=>
int(0)
["url"]=>
string(12) "预览地址"
}
}
参数:
string $media_id
使用示例:
$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->draft()->delete('MEDIA_ID');
$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->draft()->update('{
"media_id": "草稿ID",
"index": 0,
"articles": {
"title": "标题",
"author": "作者",
"digest": "摘要",
"content": "内容",
"content_source_url": "原文地址",
"thumb_media_id": "缩略图素材ID",
"show_cover_pic": 1,
"need_open_comment": 0,
"only_fans_can_comment": 0
}
}');
$obj = new \wechat\Wechat();
$obj->official()->draft()->count();
成功结果:
记录数
$obj = new \wechat\Wechat();
$obj->official()->draft()->showlist('{
"offset": 0,
"count": 20,
"no_content": 1
}');
成功结果:
参考微信开发文档结果集