module Wework::Api::Methods::Provider

Public Instance Methods

get_login_info(auth_code) click to toggle source
# File lib/wework/api/methods/provider.rb, line 10
def get_login_info auth_code
  post 'service/get_login_info', {auth_code: auth_code, access_token: access_token}
end
get_register_code(template_id, options={}) click to toggle source
# File lib/wework/api/methods/provider.rb, line 14
def get_register_code template_id, options={}
  params = {template_id: template_id}
  post 'service/get_register_code', params.merge(options)
end
get_register_url(template_id, options={}) click to toggle source
# File lib/wework/api/methods/provider.rb, line 19
def get_register_url template_id, options={}
  register_code = get_register_code(template_id, options).register_code
  "#{REGISTER_ENDPOINT}?register_code=#{register_code}"
end
sso_authorize_url(redirect_uri, user_type='admin', state='qywxlogin') click to toggle source
# File lib/wework/api/methods/provider.rb, line 5
def sso_authorize_url(redirect_uri, user_type='admin', state='qywxlogin')
  uri = ERB::Util.url_encode(redirect_uri)
  "#{SSO_AUTHORIZE_ENDPOINT}?appid=#{corp_id}&redirect_uri=#{uri}&state=#{state}&usertype=#{user_type}"
end