GithubHelp home page GithubHelp logo

shivasishdas / zoom-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donvito/zoom-go

1.0 0.0 0.0 33 KB

Zoom (Zoom.us) API Golang client library

Home Page: https://www.melvinvivas.com/zoom-api-golang-library

License: MIT License

Go 100.00%

zoom-go's Introduction

Zoom(zoom.us) API Golang Client Library

This is an unofficial Go client library for the Zoom API. I've just started and implemented the ff:

  • List Meetings
  • Create Meetings
  • Delete Meeting
  • Get Meeting by Id
  • Get Meeting Invitation
  • Add Meeting Registrant
  • List Meeting Registrants
  • Update Meeting Status/End Meeting

This library is in its infancy and has not been tested yet for production use.

Zoom API version supported

  • Version: 2.0.0
  • Host: api.zoom.us/v2

Usage

Set Environment Variables

    export ZOOM_API_URL="https://api.zoom.us/v2"
    export ZOOM_AUTH_TOKEN="<your jwt token>" 
    export ZOOM_USER_ID="<your email or username>" 

How to get your Zoom JWT token

You will need a paid account to access Zoom's REST API. You need to create a JWT App in the App Marketplace. Then, get a JWT token from the App Credentials of the app you just created. Check the instructions here https://marketplace.zoom.us/docs/guides/build/jwt-app

Download the library to your project

go get "github.com/donvito/zoom-go/zoomAPI"

Examples

List Meeting

func listMeetingExample() {

	//Create a new Zoom API client
    	apiClient := zoomAPI.NewClient(os.Getenv("ZOOM_API_URL"), os.Getenv("ZOOM_AUTH_TOKEN"))
    
    	//Retrieve the userId from the env variable
    	userId := os.Getenv("ZOOM_USER_ID")
    
    	//Use the client to list meetings
    	var resp zoomAPI.ListMeetingsAPIResponse
    	var err error
    
    	resp, err = apiClient.ListMeetings(userId)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	for _, meeting := range resp.Meetings {
    		fmt.Printf("id = %d, topic = %s, join url = %s, start time = %s\n", meeting.Id, meeting.Topic, meeting.JoinUrl, meeting.StartTime)
    	}

}

Create Meeting

func createMeetingExample() {

	//Create a new Zoom API client
    	apiClient := zoomAPI.NewClient(os.Getenv("ZOOM_API_URL"),
    		os.Getenv("ZOOM_AUTH_TOKEN"))
    
    	//Retrieve the userId from the env variable
    	userId := os.Getenv("ZOOM_USER_ID")
    
    	//Use the API client to create a meeting
    	var resp zoomAPI.CreateMeetingResponse
    	var err error
    
    	resp, err = apiClient.CreateMeeting(userId,
    		"Contributors Meeting for Project",
    		meeting.MeetingTypeScheduled,
    		"2020-05-24T22:00:00Z",
    		30,
    		"",
    		"Asia/Singapore",
    		"pass8888", //set this with your desired password for better security, max 8 chars
    		"Discuss next steps and ways to contribute for this project.",
    		nil,
    		nil)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	fmt.Printf("Created meeting : id = %d, topic = %s, join url = %s, start time = %s\n", resp.Id, 
                resp.Topic, resp.JoinUrl, resp.StartTime)

}

Delete Meeting example

func deleteMeetingExample() {

	meetingId := 84363870562

	//Create a new Zoom API client
	apiClient := zoomAPI.NewClient(os.Getenv("ZOOM_API_URL"), os.Getenv("ZOOM_AUTH_TOKEN"))

	//Use the client to list meetings
	var err error

	err = apiClient.DeleteMeeting(meetingId)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Meeting with id %d deleted", meetingId)

}

Get Meeting details by Id

func getMeetingByIdExample() {

	meetingId := 82143969140

	//Create a new Zoom API client
	apiClient := zoomAPI.NewClient(os.Getenv("ZOOM_API_URL"), os.Getenv("ZOOM_AUTH_TOKEN"))

	//Use the client to list meetings
	var err error

	var resp zoomAPI.GetMeetingResponse
	resp, err = apiClient.GetMeeting(meetingId)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Retrieved meeting : id = %d, topic = %s, join url = %s, start url = %s, start time = %s\n", resp.Id,
		resp.Topic, resp.JoinUrl, resp.StartUrl, resp.StartTime)

}

Get Meeting Invitation

func getMeetingInvitationExample() {

	meetingId := 82143969140

	//Create a new Zoom API client
	apiClient := zoomAPI.NewClient(os.Getenv("ZOOM_API_URL"), os.Getenv("ZOOM_AUTH_TOKEN"))

	//Use the client to list meetings
	var err error

	var resp zoomAPI.GetMeetingInvitationResponse
	resp, err = apiClient.GetMeetingInvitation(meetingId)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Meeting invitation = %s\n", resp.Invitation)

}

End Meeting using Update Meeting Status

func updateMeetingStatusExample(){

	//Create a new Zoom API client
	apiClient := zoomAPI.NewClient(os.Getenv("ZOOM_API_URL"),
		os.Getenv("ZOOM_AUTH_TOKEN"))

	//Use the API client to add a meeting registrant
	var err error

	meetingId := 87853332664
	err = apiClient.UpdateMeetingStatus(meetingId, "end")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Meeting status updated")

}

References

https://marketplace.zoom.us/docs/api-reference/zoom-api

Maintained by

Melvin Vivas www.melvinvivas.com

zoom-go's People

Contributors

donvito avatar

Stargazers

Roman avatar

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.