Description
This issue is about Cloud Recording.
Via API, I tried to update meeting recording setting, but failed with Response 400.
(Relevant URL: https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/recordingsettingsupdate )
Error
After I sent an PATCH requests, then I get <Response [400]>.
Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT. Hence I think the scope is not an issue as JWT’s scope is everything. (Am I correct?)
Which Endpoint/s?
How To Reproduce (If applicable)
Steps to reproduce the behavior:
http://api.zoom.us/v2/meetings/GfRucSrAQAa+gNRAiwBmew==/recordings/settings
Headers (without credentials)
headers = {
'authorization': "Bearer WITHOUTCREDENTIALS",
'content-type': "application/json"
}
(I confirmed the above header worked for “List all recordings” API task.)
Body
httpPatchOptions = {
"share_recording": "publicly",
"recording_authentication": False,
"authentication_option": None,
"authentication_domains": None,
"viewer_download": False,
"password": "1#F7*X9z",
"on_demand": False,
"approval_type": 2,
"send_email_to_host": False,
"show_social_share_buttons": False
}
See the Response 400.
Screenshots (If applicable)
Additional context
The header works for a diffenrent API task, hence I think there is no issue on authorization. The header is the JWT credentials.
I hereby attach the scripts of the screenshot.
Thanks!
zoomAPI = "http://api.zoom.us"
meetingId = "w3ZSEyrzSCCwc0seSx2y6g=="
headers = {
'authorization': "Bearer SECRET",
'content-type': "application/json"
}
httpPatchOptions = {
"share_recording": "publicly",
"recording_authentication": False,
"authentication_option": None,
"authentication_domains": None,
"viewer_download": False,
"password": "1#F7*X9z",
"on_demand": False,
"approval_type": 2,
"send_email_to_host": False,
"show_social_share_buttons": False
}
recordingSettingAPI = zoomAPI + "/v2/meetings/"+ meetingId + "/recordings/settings"
r = requests.patch(recordingSettingAPI, headers=headers, json=httpPatchOptions)
print("THIS IS THE ISSUE.--->", r)
#reference
r = requests.get(recordingSettingAPI, headers=headers)
print("For your reference, I hereby prove the header itself works. This case, the response is 200 and r.text is", r.text)
MaxM
(Max M.)
June 17, 2021, 1:09am
3
Hey @Lecture_UnivT ,
Thank you for reaching out to the Zoom Developer Forum.
Try removing those values or putting quotes around “None” as the API expects a string here:
Thanks,
Max
Dear MaxM,
Thanks for your reply.
As you kindly advised I have just tried (deleting the following part), however
"authentication_option": None,
"authentication_domains": None,
the response is still
<Response [400]>
and
r.content is the following:
b'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><error><code>300</code><message>Request Body should be a valid JSON object.</message></error>'
I tried with the following request sentences too, in vain though (all resonses were 400):
r = requests.patch(recordingSettingAPI, headers=headers, data=httpPatchOptions)
r = requests.patch(recordingSettingAPI, data=json.dumps(httpPatchOptions), headers=headers)
r = requests.patch(recordingSettingAPI, json=httpPatchOptions, headers=headers)
r = requests.patch(recordingSettingAPI, json=json.dumps(httpPatchOptions), headers=headers)
I really wish to solve this issue for the sake of my university. I am looking foward to hear from you. Thanks in advance.
MaxM
(Max M.)
June 18, 2021, 5:17am
5
Hey @Lecture_UnivT ,
Thanks for getting back to me. Along with the previous change, please also change all the False
values to be lowercase: false
That should be all you need.
Thanks,
Max
Thanks. But it does not work yet.
I still get Response 400 after running the following code.
(As this is Python, and hence false
does not work, as it would perceived as an undefined variable, and hence I put them in parentheses. )
Could you please advice me on what else I could do?
httpPatchOptions = {
"share_recording": "publicly",
"recording_authentication": "false",
"viewer_download": "false",
"password": "1#F7*X9z",
"on_demand": "false",
"approval_type": 2,
"send_email_to_host": "false",
"show_social_share_buttons": "false",
}
recordingSettingAPI = zoomAPI + "/v2/meetings/"+ meetingId + "/recordings/settings"
print(recordingSettingAPI)
r = requests.patch(recordingSettingAPI, data=json.dumps(httpPatchOptions), headers=headers)
MaxM
(Max M.)
June 21, 2021, 8:05pm
7
Hey @Lecture_UnivT ,
Thanks for testing that out and for clarifying - I didn’t realize you were showing me Python code.
Would you be able to provide the output of that function so that I can check the request body directly?
I’ll use that to double check a valid request is being sent.
Thanks,
Max
Hi MaxM,
Thanks for your response.
Regarding your clarifying question, the output of the json.dumps function is the following:
jsonDumped = json.dumps(httpPatchOptions)
print(jsonDumped)
print(type(jsonDumped))
And the printed outputs are the following:
{"share_recording": "publicly", "recording_authentication": "false", "viewer_download": "false", "password": "1#F7*X9z", "on_demand": "false", "approval_type": 2, "send_email_to_host": "false", "show_social_share_buttons": "false"}
<class 'str'>
In the next post, I will write all the Python code so that there is no missing info that I should hand in to you.
In addition to my reply above, I hereby attach the whole Python script (with an appropriate mask on the JTW thing)
import requests
import json
zoomAPI = "http://api.zoom.us"
meetingId = "w3ZSEyrzSCCwc0seSx2y6g=="
headers = {
'authorization': "Bearer THISISSECRET",
'content-type': "application/json"
}
httpPatchOptions = {
"share_recording": "publicly",
"recording_authentication": "false",
"viewer_download": "false",
"password": "1#F7*X9z",
"on_demand": "false",
"approval_type": 2,
"send_email_to_host": "false",
"show_social_share_buttons": "false",
}
recordingSettingAPI = zoomAPI + "/v2/meetings/"+ meetingId + "/recordings/settings"
print(recordingSettingAPI, "\n")
r = requests.patch(recordingSettingAPI, data=json.dumps(httpPatchOptions), headers=headers)
jsonDumped = json.dumps(httpPatchOptions)
print(jsonDumped)
print(type(jsonDumped))
print("THIS IS THE ISSUE.--->", r)
print(r.content)
The printed outputs are the following:
http://api.zoom.us/v2/meetings/w3ZSEyrzSCCwc0seSx2y6g==/recordings/settings
{"share_recording": "publicly", "recording_authentication": "false", "viewer_download": "false", "password": "1#F7*X9z", "on_demand": "false", "approval_type": 2, "send_email_to_host": "false", "show_social_share_buttons": "false"}
<class 'str'>
THIS IS THE ISSUE.---> <Response [400]>
b'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><error><code>300</code><message>Request Body should be a valid JSON object.</message></error>'
MaxM
(Max M.)
June 23, 2021, 12:46am
10
Hey @Lecture_UnivT ,
Thank you for providing that information. I used the request body that you’re using but wasn’t able to see the same issue - even though boolean values are represented as strings. The request went through with a 204 response.
Please send an email to developersupport@zoom.us with a link to this thread. In that email, I’ll continue my efforts to reproduce the issue and set up a meeting to troubleshoot live if necessary.
Thanks,
Max
MaxM:
Dear MaxM,
Thanks for your kind reply.
I have just sent an email to the email address.
I surely appreciate that I would get your advices via emails from now on.
Thank you very much.
MaxM
(Max M.)
June 24, 2021, 2:14am
12
Hey @Lecture_UnivT ,
Great! Thank you for submitting a ticket - I’ll follow up with you there.
Thanks,
Max