Update Meeting API returns a 400 response - request body is not a valid JSON object

I am successfully using the create meeting api to create meetings and the delete api to delete meetings. I cannot get the update meeting api to work. It keeps returning a 400 response.

I tried it out in the “Send A Test Request” tool and get the same error. Both using my code and the “Send A Test Request” tool, the error returned is that the request body is not a valid JSON object.
The body used in the “Send A Test Request” tool is the dummy body provided by the tool.

Hey @zulema,

Thank you for reaching out to the Zoom Developer Forum. Please provide the request body and the headers that you’re using when you get that response. Based on the XML response that you’re getting, it seems that the wrong request body format or Content-Type header may be set.

Thanks,
Max

Here is the code I am using. Content-type is application/json. If I json.dump the data dict instead of just sending the data dict, I get a 204 response but the response body is null. Would really appreciate some help.

code

        payload = {
            'iss': api_key,
            'exp': datetime.utcnow() + timedelta(hours=2)
        }
        token = jwt.encode(payload, api_sec)

        # call API: edit meeting
        url = 'https://api.zoom.us/v2/meetings/' + id
        headers = {
            'authorization': "Bearer %s" % token,
            'content-type': "application/json"
        }
        data = {
            'topic': form.name.data,
            'agenda': form.agenda.data,
            'type': 2,
            'start_time': meetingDate.strftime('%Y-%m-%d') + 'T' + startTime.strftime('%H:%M:%S'),
            'duration': form.duration.data,
            'timezone': 'America/New_York',
            'password': form.password.data,
            'settings': {
                'host_video': form.start_meeting_when_host_joins.data,
                'participant_video': form.start_meeting_when_participant_joins.data,
                'waiting_room': form.waiting_room.data,
                'join_before_host': form.join_before_host.data,
                'jbh_time': form.jbh_time.data,
                'mute_upon_entry': form.mute_upon_entry.data,
                'approval_type': form.approval_type.data,
                'meeting_authentication': form.meeting_authentication.data,
                'allow_multiple_devices': form.allow_multiple_devices.data
            }
        }
        r = requests.patch(url, data=data, headers=headers)
        if r.status_code != 204:
            flash('Zoom api call failed - return status: %s' % r.status_code, 'danger')
            return render_template(
                'zoom/action_zoom_meeting.html',
                jumbotron_content='zoom/zoom_jumbotron.html',
                form=form,
                action='Edit'
                )

Hey @zulema,

Thank you for providing additional information. When you see a 204 response, do you also see that the meeting was updated in the Zoom Portal? Are you able to send the request body that you’re using on the “Send a Test Request” page?

Thanks,
Max

When I get a 204 response, the meeting DOES update the meeting in the Zoom portal. The response I get does not have a valid JSON body. I get this error when tryin to decode the response (it is None)

File “/usr/lib/python3.7/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I have just reread the api documentation and realized that the api does NOT return a body in the response - just a return code!

Hey @zulema,

Thank you for providing additional information. A 204 status is actually the expected response when you successfully complete the Update a Meeting API request. We can confirm this by reviewing the documentation’s response section:

An HTTP 204 status indicates that the request was success full but there was No Content. From here, you’ll want to add logic to your code that checks the status returned before attempting to parse a response.

I hope that helps! Let me know if you have any questions.

Thanks,
Max