diff --git a/.gitignore b/.gitignore index 0cb6eeb..d844320 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /pkg/ /spec/reports/ /tmp/ +/.idea \ No newline at end of file diff --git a/lib/dingtalk/api/callback.rb b/lib/dingtalk/api/callback.rb new file mode 100644 index 0000000..9634ddf --- /dev/null +++ b/lib/dingtalk/api/callback.rb @@ -0,0 +1,23 @@ +module Dingtalk + module Api + class Callback < Base + + def reg_callback url, tags = ['user_add_org', 'user_modify_org', 'user_leave_org', 'org_dept_create', 'org_dept_modify', 'org_dept_remove'] + params = { + call_back_tag: tags, + token: Dingtalk.suite_token, + aes_key: Dingtalk.suite_aes_key, + url: url + } + http_post("register_call_back?access_token=#{access_token}", params) + end + + private + + def base_url + 'call_back' + end + + end + end +end