Commit bc64cef85fedbbb68a1d1d84bac59004b3c7966e

Authored by Jeff Lai
1 parent a00d8462
Exists in master

Add suite apis: activate_suite & get_auth_info

Showing 1 changed file with 20 additions and 0 deletions   Show diff stats
lib/dingtalk/api/suite.rb
@@ -47,6 +47,26 @@ module Dingtalk @@ -47,6 +47,26 @@ module Dingtalk
47 redis.get("#{corp_id}_#{ACCESS_TOKEN}") 47 redis.get("#{corp_id}_#{ACCESS_TOKEN}")
48 end 48 end
49 49
  50 + def activate_suite(corp_id, permanent_code)
  51 + params = {
  52 + suite_key: @suite_key,
  53 + suite_access_token: suite_access_token,
  54 + permanent_code: permanent_code,
  55 + auth_corpid: corp_id
  56 + }
  57 + http_post('activate_suite', params)
  58 + end
  59 +
  60 + def get_auth_info(corp_id, permanent_code)
  61 + params = {
  62 + suite_key: @suite_key,
  63 + suite_access_token: suite_access_token,
  64 + permanent_code: permanent_code,
  65 + auth_corpid: corp_id
  66 + }
  67 + http_post('get_auth_info', params)
  68 + end
  69 +
50 def suite_ticket 70 def suite_ticket
51 redis.get(SUITE_TICKET) 71 redis.get(SUITE_TICKET)
52 end 72 end