Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Last active April 26, 2021 15:42
Show Gist options
  • Save JoeGlines/4c2b16bdb9cd562ce64dd9f27198bb7e to your computer and use it in GitHub Desktop.
Save JoeGlines/4c2b16bdb9cd562ce64dd9f27198bb7e to your computer and use it in GitHub Desktop.
Connecting to the new V2 Zoom API with AutoHotkey is easy
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;*******************************************************
#SingleInstance,Force
;************************************************************
;~ https://marketplace.zoom.us/develop/apps
;~ JWT JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
JWT_Token:="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOm51bGwsImlzcyI6Imh3b0JNUEFLVDdXTFcyMmVjX05WR3ciLCJleHAiOjE1ODg1MjU4NzUsImlhdCI6MTU4ODUyMDQ3NH0.UF5dx0UJvc8QiWFi1lnE_-opkmKYlqQlXTRNEpUXb5w"
;~ EndPoint:="https://api.zoom.us/v2/users/[email protected]/meetings"
EndPoint:="https://api.zoom.us/v2/meetings/82188609499/registrants?page_size=100" ;page_number=2
Reg:=API_Call("GET",Endpoint,QS,JWT_Token,Payload)
;~ M(registrants)
for key, value in Reg.Registrants {
;~ Last_name:=value.Last_name
;~ First_name:=value.First_name
;~ email:=value.email
data.=value.First_name a_tab value.Last_name a_tab value.email "`n"
}
MsgBox % Data
return
;********API call**********************
API_Call(Type,Endpoint,QS,JWT_Token,Payload){
HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1") ;Create COM Object
HTTP.Open(TYPE,EndPoint QS) ;Start the request
HTTP.SetRequestHeader("Authorization","Bearer " JWT_Token) ;Authorization in the form of a Bearer token
HTTP.SetRequestHeader("Content-Type","application/json") ;JSON
HTTP.Send(Payload) ;If POST request put data in "Payload" variable
oAHK:=ParseJSON(HTTP.ResponseText) ;Make sure the ParseJSON function is in your library
DebugWindow(Obj2String(oAHK),1,1,200,0)
Return oAHK ;Return the object
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment