Add this line to your application's Gemfile:
gem 'ding_talk', git: "https://gitee.com/bulexu/ding_talk"
And then execute:
$ bundle
DingTalk.configure do |config|
config.redis = Redis.new(host: ENV['REDIS_HOST'], port: ENV['REDIS_PORT'], db: ENV['REDIS_CACHE_DB']) # redis
config.http_timeout_options = {write: 15, read: 15, connect: 10} # 请求超时
config.expired_shift_seconds = 180 # access token 有效期偏移量 (时间有效期 - 偏移量)
end
初始化接口 DingTalk::Api::Agent
$agent_api = DingTalk::Api::Agent.new(
corp_id: ENV['CORP_ID'], # 企业ID
agent_id: ENV['AGENT_ID'], # 应用ID
app_key: ENV['APP_KEY'], # 应用app_key
app_secret: ENV['APP_SECRET'] # 应用app_secret
)
DingTalk::Api::Methods::Department
DingTalk::Api::Methods::Message
- Fork
DingTalk
on Gitee/GitHub - Make your changes
- Ensure all tests pass (
rake spec
) - Send a pull request
- If we like them we'll merge them
- If we've accepted a patch, feel free to ask for commit access!
Bug reports and pull requests are welcome on Gitee at https://gitee.com/bulexu/ding_talk.
Bug reports and pull requests are welcome on GitHub at https://github.com/bulexu/ding_talk.