Code Monkey home page Code Monkey logo

zoom_rb's Introduction

zoom_rb CircleCI Maintainability Test Coverage

Ruby wrapper gem for zoom.us API (currently v2)

Installation

Add this line to your application's Gemfile:

gem 'zoom_rb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install zoom_rb

Usage

The Zoom API uses OAuth or JWT to Authenticate API request. By default, a JWT client will be used.

Zoom.configure do |c|
  c.api_key = 'xxx'
  c.api_secret = 'xxx'
end

zoom_client = Zoom.new

To create an OAuth flow you need to make a call to auth, then create the client directly from an access token.

First you need to get an auth_code externally from:

https://zoom.us/oauth/authorize?response_type=code&client_id=7lstjKqdwjett_kwjwDSEQ&redirect_uri=https://yourapp.com

Which will result in a redirect to your app with code in the url params

then use this code to get an access token and a refresh token.

auth = Zoom::Client::OAuth.new(auth_code: auth_code, redirect_uri: redirect_uri, timeout: 15).auth

zoom_client = Zoom::Client::OAuth.new(access_token: auth['access_token'], timeout: 15)

You can also make a call to refresh with auth using an auth_token and a refresh_token

client = Zoom::Client::OAuth.new(auth_token: auth_token, refresh_token: refresh_token).auth

zoom_client = Zoom::Client::OAuth.new(access_token: 'xxx', timeout: 15)

With the zoom client, access the API

user_list = zoom_client.user_list
user_list['users'].each do |user|
  user_id = user['id']
  puts zoom_client.meeting_list(user_id: user_id)
end

begin
  user_list = zoom_client.user_list!
rescue Zoom::Error => exception
  puts 'Something went wrong'
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.