Module: Zoom::Actions::Token

Included in:
Client
Defined in:
lib/zoom/actions/token.rb

Instance Method Summary collapse

Instance Method Details

#access_tokens(*args) ⇒ Object



6
7
8
9
10
11
# File 'lib/zoom/actions/token.rb', line 6

def access_tokens(*args)
  options = Zoom::Params.new(Utils.extract_options!(args))
  options.require(i[auth_code redirect_uri])
  response = self.class.post("/oauth/token?grant_type=authorization_code&code=#{options[:auth_code]}&redirect_uri=#{options[:redirect_uri]}", headers: oauth_request_headers, base_uri: 'https://zoom.us/')
  Utils.parse_response(response)
end

#data_compliance(*args) ⇒ Object



20
21
22
23
24
25
# File 'lib/zoom/actions/token.rb', line 20

def data_compliance(*args)
  options = Zoom::Params.new(Utils.extract_options!(args))
  options.require(i[client_id user_id  deauthorization_event_received compliance_completed])
  response = self.class.post("/oauth/data/compliance", body: options.to_json, headers: oauth_request_headers, base_uri: 'https://zoom.us/')
  Utils.parse_response response
end

#refresh_tokens(*args) ⇒ Object



13
14
15
16
17
18
# File 'lib/zoom/actions/token.rb', line 13

def refresh_tokens(*args)
  options = Zoom::Params.new(Utils.extract_options!(args))
  options.require(:refresh_token)
  response = self.class.post("/oauth/token?grant_type=refresh_token&refresh_token=#{options[:refresh_token]}", headers: oauth_request_headers, base_uri: 'https://zoom.us/')
  Utils.parse_response(response)
end

#revoke_tokens(*args) ⇒ Object



27
28
29
30
31
32
# File 'lib/zoom/actions/token.rb', line 27

def revoke_tokens(*args)
  options = Zoom::Params.new(Utils.extract_options!(args))
  options.require(i[access_token])
  response = self.class.post("/oauth/revoke?token=#{options[:access_token]}", headers: oauth_request_headers, base_uri: 'https://zoom.us/')
  Utils.parse_response(response)
end