From 6bd96972852b79abd785976287cabbdf400715af Mon Sep 17 00:00:00 2001 From: LesterZhao Date: Fri, 24 Jun 2016 12:02:07 +0800 Subject: [PATCH] 管理素材API bug修改 (#23) --- lib/qy_wechat_api/api/material.rb | 2 +- lib/qy_wechat_api/client.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/qy_wechat_api/api/material.rb b/lib/qy_wechat_api/api/material.rb index beefc0f..0fd46d2 100644 --- a/lib/qy_wechat_api/api/material.rb +++ b/lib/qy_wechat_api/api/material.rb @@ -24,7 +24,7 @@ module QyWechatApi # https://qyapi.weixin.qq.com/cgi-bin/material/add_material?agentid=AGENTID&type=TYPE&access_token=ACCESS_TOKEN def add_material(agent_id, type, file) check_masterial_type(type) - http_post("upload", {media: file}, {type: type, agentid: agent_id}) + http_post("add_material", {media: file}, {type: type, agentid: agent_id}) end # 删除永久素材 diff --git a/lib/qy_wechat_api/client.rb b/lib/qy_wechat_api/client.rb index b5a8d39..ac8f191 100644 --- a/lib/qy_wechat_api/client.rb +++ b/lib/qy_wechat_api/client.rb @@ -49,6 +49,11 @@ module QyWechatApi Api::Media.new(get_access_token) end + # 管理素材API + def material + Api::Material.new(get_access_token) + end + def message Api::Message.new(get_access_token) end -- libgit2 0.21.0