# Deleting Webinar via restAPI - problem

**URL:** <https://devforum.zoom.us/t/deleting-webinar-via-restapi-problem/5979>\
**Category:** API and Webhooks\
**Created:** [September 20, 2019, 7:30pm UTC](https://devforum.zoom.us/t/deleting-webinar-via-restapi-problem/5979 "2019-09-20T19:30:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![huetherb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/huetherb/32/1758_2.png) [@huetherb](https://devforum.zoom.us/u/huetherb)\
**Post date:** [September 20, 2019, 7:30pm UTC](https://devforum.zoom.us/t/deleting-webinar-via-restapi-problem/5979/1 "2019-09-20T19:30:39Z")

</div>

Hi, I am using the following to delete a webinar:

```auto
 $curl = curl_init();
                $url = 'https://api.zoom.us/v2/webinars/'.$webinarinstance->zoomid;
                curl_setopt_array($curl, array(
                    CURLOPT_URL => $url,
                    CURLOPT_RETURNTRANSFER => true,
                    CURLOPT_ENCODING => "",
                    CURLOPT_MAXREDIRS => 10,
                    CURLOPT_TIMEOUT => 30,
                    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                    CURLOPT_CUSTOMREQUEST => "POST",
                    CURLOPT_HTTPHEADER => array(
                        "authorization: Bearer mytoken",
                        "content-type: application/json"
                    ),
                ));

                $response = curl_exec($curl);

```

THe variables I get dynamically and they are fine. I don’t get a zoom error but I get a huge response (not json) with a bunch of html, css, and js.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 20, 2019, 7:39pm UTC](https://devforum.zoom.us/t/deleting-webinar-via-restapi-problem/5979/2 "2019-09-20T19:39:08Z")

</div>

Hey @huetherb,

Simple mistake, the “POST” should be a “DELETE” request.

`CURLOPT_CUSTOMREQUEST => "DELETE",`

```auto
 $curl = curl_init();
                $url = 'https://api.zoom.us/v2/webinars/'.$webinarinstance->zoomid;
                curl_setopt_array($curl, array(
                    CURLOPT_URL => $url,
                    CURLOPT_RETURNTRANSFER => true,
                    CURLOPT_ENCODING => "",
                    CURLOPT_MAXREDIRS => 10,
                    CURLOPT_TIMEOUT => 30,
                    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                    CURLOPT_CUSTOMREQUEST => "DELETE",
                    CURLOPT_HTTPHEADER => array(
                        "authorization: Bearer mytoken",
                        "content-type: application/json"
                    ),
                ));

                $response = curl_exec($curl);

```

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![huetherb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/huetherb/32/1758_2.png) [@huetherb](https://devforum.zoom.us/u/huetherb)\
**Post date:** [September 20, 2019, 7:41pm UTC](https://devforum.zoom.us/t/deleting-webinar-via-restapi-problem/5979/3 "2019-09-20T19:41:40Z")

</div>

Just realized that! thanks!

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 20, 2019, 7:45pm UTC](https://devforum.zoom.us/t/deleting-webinar-via-restapi-problem/5979/4 "2019-09-20T19:45:14Z")

</div>

Happy to help 🙂

-Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 6:42pm UTC](https://devforum.zoom.us/t/deleting-webinar-via-restapi-problem/5979/5 "2020-08-21T18:42:59Z")

</div>

Closed on August 21, 2020, 6:42pm UTC


