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