# Delete Zoom Meeting via Api , Getting Error 300 Content Type Unsupported

**URL:** <https://devforum.zoom.us/t/delete-zoom-meeting-via-api-getting-error-300-content-type-unsupported/97591>\
**Category:** Meetings\
**Tags:** webhooks, api\
**Created:** [October 31, 2023, 9:51am UTC](https://devforum.zoom.us/t/delete-zoom-meeting-via-api-getting-error-300-content-type-unsupported/97591 "2023-10-31T09:51:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![msiddique](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@msiddique](https://devforum.zoom.us/u/msiddique)\
**Post date:** [October 31, 2023, 9:51am UTC](https://devforum.zoom.us/t/delete-zoom-meeting-via-api-getting-error-300-content-type-unsupported/97591/1 "2023-10-31T09:51:59Z")

</div>

I intend to end a zoom meeting via its api, I am trying to call the api but it gives me the error:  
Error: \<?xml version="1.0" encoding="UTF-8" standalone="yes"?\>`300`Unsupported Content Type

I am working on flask . I have written two functions for end meeting anticipating what type of response api wants but both give same error;

def end\_meeting(meeting\_id, auth\_token):  
url = f"[https://api.zoom.us/v2/meetings/{meeting\_id}/status](https://api.zoom.us/v2/meetings/%7Bmeeting_id%7D/status)"  
headers = {  
‘Authorization’: f"Bearer {auth\_token}",  
‘Content-Type’: ‘application/x-www-form-urlencoded’ # Adjusting content type to form data  
}  
data = {  
‘action’: ‘end’  
}

```
response = requests.put(url, headers=headers, data=data) # Send form data

if response.status_code == 204:
    return f"Meeting {meeting_id} has been successfully ended."
else:
    return f"Failed to end meeting {meeting_id}. Error: {response.text}"

```

def end\_meeting(meeting\_id, auth\_token):

# url = f"[https://api.zoom.us/v2/meetings/{meeting\_id}/status](https://api.zoom.us/v2/meetings/%7Bmeeting_id%7D/status)"

# headers = {

# ‘Authorization’: f"Bearer {auth\_token}",

# ‘Content-Type’: ‘application/json’ # Adjusting the content type to ‘application/json’

# }

# data = {

# ‘action’: ‘end’

# }

# response = requests.put(url, headers=headers, data=json.dumps(data)) # Send data as JSON

# if response.status\_code == 204:

# return f"Meeting {meeting\_id} has been successfully ended."

# else:

# return f"Failed to end meeting {meeting\_id}. Error: {response.text}"

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [October 31, 2023, 8:53pm UTC](https://devforum.zoom.us/t/delete-zoom-meeting-via-api-getting-error-300-content-type-unsupported/97591/2 "2023-10-31T20:53:16Z")

</div>

@msiddique The error seems to be with your code.

Can you please send us the complete payload that you are sending when making the API request to zoom?

---

<div class="post-metadata">

**Author:** ![msiddique](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@msiddique](https://devforum.zoom.us/u/msiddique)\
**Post date:** [November 1, 2023, 8:52am UTC](https://devforum.zoom.us/t/delete-zoom-meeting-via-api-getting-error-300-content-type-unsupported/97591/3 "2023-11-01T08:52:22Z")

</div>

i changed it to this:  
def end\_meeting(meeting\_id, auth\_token):  
url = f"[https://api.zoom.us/v2/meetings/{meeting\_id}/status](https://api.zoom.us/v2/meetings/%7Bmeeting_id%7D/status)"  
headers = {  
‘Authorization’: f"Bearer {auth\_token}",  
‘Content-Type’: ‘application/json’  
}  
data = {  
‘action’: ‘end’  
}  
response = requests.put(url, headers=headers, json=data)

```
if response.status_code == 204:
    return f"Meeting {meeting_id} has been successfully ended."
else:
    return f"Failed to end meeting {meeting_id}. Error: {response.text}"

```

and javascript tot his:  
document.getElementById(“End-Button”).addEventListener(“click”, function() {  
var meetingId = document.getElementById(“instant-ID”).value; // Retrieve the meeting ID

```
// Check if meeting ID is not empty before proceeding
if (meetingId.trim() === '') {
    console.log("Meeting ID is empty");
    return; // Prevent sending an empty meeting ID
}

// Data to be sent in the request
var data = { meeting_id: meetingId };

// AJAX request to the Flask route to end the meeting
fetch('/meetings/end_meeting_route', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(data) // Sending meeting_id as JSON data
})
.then(response => response.text())
.then(result => {
    console.log(result); // Log the result from the Flask route
    // You can perform further actions based on the result if needed
})
.catch(error => {
    console.error('Error:', error);
});

```

});

still not working

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [November 1, 2023, 11:05pm UTC](https://devforum.zoom.us/t/delete-zoom-meeting-via-api-getting-error-300-content-type-unsupported/97591/4 "2023-11-01T23:05:32Z")

</div>

Can you send it in cURL format?
