edgi-govdata-archiving / edgi-hubot-halpy

Heroku-backed chatbot-friend who lives in EDGI Slack
https://edgi-hubot.herokuapp.com/
3 stars 0 forks source link

update zoom script to v2 of API #36

Closed titaniumbones closed 5 years ago

titaniumbones commented 5 years ago

The current version of the Zoom API is v2; we are using the old v1 API, which wil lbe sunset on November 1, 2018.

titaniumbones commented 5 years ago

Feeling like this is not a good use of my time b/c I'm so slow with this. I have started experimenting w/ the API a bit in postman -- please hit me up if you want e.g. the jwt.io token I've generated or access to the (inadequate) postman environment I've created by ofllowing the zoom instructions (https://developer.zoom.us/blog/using-zoom-apis-version-2-with-postman/)

titaniumbones commented 5 years ago

Was able to make a valid CURL request, finally (!), after copying the command listed in htis support request on the Zoom website

here's my valid code:

curl -X POST \
https://api.zoom.us/v2/users/KEEPINGUSERIDSECRETIGUESS/meetings \
-H 'Authorization: Bearer ASKMEFORTOKENORGENERATEYRSELF' \
-H 'Cache-Control: no-cache' \       
-H 'Content-Type: application/json' \
-d '{                        
"topic": "Test meeting json",
"type": 1,                           
"start_time": "2018-12-25T14:00:00Z",
"agenda": "To test recurring meeting"
}'
titaniumbones commented 5 years ago

Also, you can get the userid you need for hte previous command with:

 curl \
https://api.zoom.us/v2/users?status=active&page_size=30&page_number=1 \
-H 'Authorization: Bearer ASKMEFORTOKENORGENERATEYOURSELF' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
| cat | jq '.users[0].id'   

the last line just pipes output through the command-lin jq json parser so you cna cut that if yo uwant.

titaniumbones commented 5 years ago

Updated in zoom-scratch.coffee. Seems to work fine and allows us to do a few more things.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in seven days if no further activity occurs. If it should not be closed, please comment! Thank you for your contributions.