Hey Will, here’s the section of code that has to do with submitting recordings and webinar registrations. finOrNot is a simple boolean representing whether or not a user is submitting the form 3 hours after the scheduled start time, and approval is a boolean representing whether or not a user’s email is present on a list. standardPOSTH() is a function that just returns the usual headers (content-type json and the bearer token) into a variable.
#WEBINAR ADD
url = zoomBaseURL + meetingType + "/" + str(meetID) + "/registrants"
payload = "{\"email\": \"" + email + "\",\"first_name\": \"" + chimpInfo["fname"] + "\", \"last_name\": \"" + chimpInfo["lname"] + "\", \"org\": \"" + chimpInfo["company"] + "\"}"
headers = standardPOSTH()
response = requests.request("POST", url, headers=headers, data = payload) #makes the request
meeting = response.json() #translates the json object into a dictionary
if approval:
#WEBINAR APPROVE
url = zoomBaseURL + meetingType + "/" + str(meetID) + "/registrants/status"
payload = '''{\"action\": \"approve\",\"registrants\": [{\"id\": \"'''+ meeting["registrant_id"] + '''\",\"email\": \"''' + email + '''\"}]}'''
headers = standardPOSTH()
response = requests.request("PUT", url, headers=headers, data = payload)
if finOrNot == True: #ADD THEM AND APPROVE THEM TO WEBINAR FIRST
#ADD AS RECORDING REGISTRANT
url = zoomBaseURL + "meetings/" + str(meetID) + "/recordings/registrants"
payload = "{\"email\": \"" + email + "\",\"first_name\": \"" + chimpInfo["fname"] + "\", \"last_name\": \"" + chimpInfo["lname"] + "\", \"org\": \"" + chimpInfo["company"] + "\"}"
headers = standardPOSTH()
response = requests.request("POST", url, headers=headers, data = payload) #makes the request
meeting = response.json() #translates the json object into a dictionary
if approval:
#RECORDING APPROVE
url = zoomBaseURL + "meetings/" + str(meetID) + "/recordings/registrants/status"
payload = '''{\"action\": \"approve\",\"registrants\": [{\"id\": \"''' + meeting["registrant_id"] + '''\"}]}'''
headers = standardPOSTH()
response = requests.request("PUT", url, headers=headers, data = payload)
The problem isn’t that the request fails – just the opposite. I get no error message at all, only a 204 response with no body, every time I run that last request.
An example ID for the recording would be 84696057299, and a user with the ID of XniCo0p9QVmiBJqxK6QxJw tried to register, but it didn’t go through, despite returning a 204.