Using AutoHotkey to access Zooms updated v2 API

Someone mentioned that the Zoom API had changed significantly since I made this post and was hoping I’d update my code to help people.   I did a little digging and updated my code to utiilze the new Zoom API V2 (version 1 will be sunset at the end of May 2020).

Using AutoHotkey to access Zooms updated v2 API

Using AutoHotkey to access Zooms updated v2 API


#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
}

Comments are closed.