# Webhook event 'webinar.ended' continuing to return 500 error

**URL:** <https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050>\
**Category:** API and Webhooks\
**Created:** [September 27, 2019, 7:18pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050 "2019-09-27T19:18:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![twentyoverten](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/twentyoverten/32/1919_2.png) [@twentyoverten](https://devforum.zoom.us/u/twentyoverten)\
**Post date:** [September 27, 2019, 7:18pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/1 "2019-09-27T19:18:13Z")

</div>

## Description/Error

I’ve setup a webhook for the `webinar.ended` event that pings our URL. Our URL takes the webinar UUID and does a callback to the zoom “Get Webinar Absentees” API endpoint. We’re doing this so we can get a list of registrants that didn’t attend. It’s working intermittently, and the webhook keeps firing repeatedly, often returning a 500 error in the zoom call logs.

It seems to be throwing a 404 error on the “Get Webinar Absentees” endpoint. Here’s an example of the URL being requested (using the UUID returned from the webhook): [https://api.zoom.us/v2/past\_webinars/GcQQNt4cSx2u1Q/e/+evzw==/absentees?page\_size=300](https://api.zoom.us/v2/past_webinars/GcQQNt4cSx2u1Q/e/+evzw==/absentees?page_size=300)

I’m unsure what’s going on here, as it seems to work, but then keeps triggering the webhook and erroring other times.

## Which Endpoint/s or Web JS SDK?

[https://marketplace.zoom.us/docs/api-reference/webhook-reference/webinar-events/webinar-ended](https://marketplace.zoom.us/docs/api-reference/webhook-reference/webinar-events/webinar-ended)  
[https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarabsentees](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarabsentees)

## How To Reproduce

**Our Event notification endpoint:**

```javascript
app.post("/api/webinar/ended", async (req, res) => {
  try {
    const webinar = req.body;
    const webinarAbsintees = await getWebinarAbsentees(
      webinar.payload.object.uuid
    );
    sendWebinarFollowUp(webinarAbsintees);
    res.sendStatus(200);
  } catch (e) {
    console.log('---- WEBINAR/ENDED ERROR ----')
    console.error(e)
    res.sendStatus(200);
  }
});

```

**Our Get Webinar Absentees function:**

```javascript
const getWebinarAbsentees = uid => {
  const payload = {
    iss: API_KEY,
    exp: new Date().getTime() + 5000
  };
  const token = jwt.sign(payload, API_SECRET);

  const options = {
    uri:
      "https://api.zoom.us/v2/past_webinars/" +
      uid +
      "/absentees?page_size=300",
    auth: {
      bearer: token
    },
    headers: {
      "User-Agent": "Zoom-api-Jwt-Request",
      "content-type": "application/json"
    },
    json: true
  };

  return rp(options);
};

```

### Screenshots

You can see our call logs keep retrying the same endpoing over and over, sometimes working, other times not:

 ![51%20PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/8/8a192ac76eea1470b42d9549be83562fab280cb8.jpeg)

---

<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 27, 2019, 8:27pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/2 "2019-09-27T20:27:37Z")

</div>

Hey @twentyoverten, thanks for the detailed post.

I belive the issue is the uuid including `/` which messes up the url and causes a 404.

To fix this, double url encode the uuid:

> [@Wrong symbols in UUID (/V78xyi7TdmMToeYJhFaNA==)](https://devforum.zoom.us/t/wrong-symbols-in-uuid-v78xyi7tdmmtoeyjhfana/5986/2):
>
> Hey @andrey.petrenko, thanks for the post and using Zoom! Can you try double url encoding the meeting UUID /V78xyi7TdmMToeYJhFaNA==? So after you double url encode, pass this in as your meeting UUID %252FV78xyi7TdmMToeYJhFaNA%253D%253D [https://www.urlencoder.org](https://www.urlencoder.org/) Let me know if that works! Thanks, Tommy

As for the webhook throwing a 500, can you expand the request by clicking the arrow on the right ([App Marketplace](https://marketplace.zoom.us/user/logs))? I want to see if there is an error message.

Let me know if this helps!

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![twentyoverten](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/twentyoverten/32/1919_2.png) [@twentyoverten](https://devforum.zoom.us/u/twentyoverten)\
**Post date:** [September 27, 2019, 8:52pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/3 "2019-09-27T20:52:42Z")

</div>

Thanks @tommy, just to clarify:

The UUID seems to be this: `GcQQNt4cSx2u1Q/e/+evzw==`

You want me to double URL encode it, so would that mean just:

```javascript
escape(encodeURIComponent('GcQQNt4cSx2u1Q/e/+evzw=='))

```

Which results in: `GcQQNt4cSx2u1Q%252Fe%252F%252Bevzw%253D%253D`

**Is that correct?**

---

<div class="post-metadata">

**Author:** ![twentyoverten](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/twentyoverten/32/1919_2.png) [@twentyoverten](https://devforum.zoom.us/u/twentyoverten)\
**Post date:** [September 27, 2019, 8:53pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/4 "2019-09-27T20:53:44Z")

</div>

And here is the webhook 500 request:

 ![47%20PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/2/2882f5bdce9322aee6adb6519c834bfd8547ee91.png)

---

<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 27, 2019, 8:57pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/5 "2019-09-27T20:57:32Z")

</div>

Hey @twentyoverten,

> [@twentyoverten](#):
>
> Is that correct?

Yes 🙂

Thanks for sharing the webhook request, with the “Read timed out” error I am guessing it’s caused because you are not [sending the response back to Zoom within a few seconds.](https://marketplace.zoom.us/docs/api-reference/webhook-reference#notification-delivery)

I updated your code, try this and let me know if you still get a 500 error:

```js
app.post("/api/webinar/ended", async (req, res) => {
res.sendStatus(200);
  try {
    const webinar = req.body;
    const webinarAbsintees = await getWebinarAbsentees(
      encodeURIComponent(encodeURIComponent(webinar.payload.object.uuid))
    );
    sendWebinarFollowUp(webinarAbsintees);
  } catch (e) {
    console.log('---- WEBINAR/ENDED ERROR ----')
    console.error(e)
  }
});

```

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![twentyoverten](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/twentyoverten/32/1919_2.png) [@twentyoverten](https://devforum.zoom.us/u/twentyoverten)\
**Post date:** [September 27, 2019, 9:04pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/6 "2019-09-27T21:04:00Z")

</div>

Thanks @tommy! That all makes sense.

Only thing missing in the code you updated is wrapping that uuid var in the double url encode right?

I’ll give this a go and let you know if I run into any more issues!

---

<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 27, 2019, 9:05pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/7 "2019-09-27T21:05:21Z")

</div>

Happy to help @twentyoverten!

> [@twentyoverten](#):
>
> Only thing missing in the code you updated is wrapping that uuid var in the double url encode right?

Correct, I will update the code 🙂

(also fyi js [escape is deprecated](https://www.w3schools.com/jsref/jsref_escape.asp), use `encodeURIComponent(encodeURIComponent('GcQQNt4cSx2u1Q/e/+evzw=='))`

Let me know if this works / doesn’t work!

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![twentyoverten](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/twentyoverten/32/1919_2.png) [@twentyoverten](https://devforum.zoom.us/u/twentyoverten)\
**Post date:** [September 27, 2019, 9:16pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/8 "2019-09-27T21:16:50Z")

</div>

@tommy unfortunately that didn’t work ☹

Immediately got an error on the server:

```auto
body: { code: 3001, message: 'Meeting ID is invalid or not end.' } } }

```

You can see this was the URL requested with teh double encode:

```nohighlight
https://api.zoom.us/v2/past_webinars/GcQQNt4cSx2u1Q%252Fe%252F%252Bevzw%253D%253D/absentees?page_size=300

```

---

<div class="post-metadata">

**Author:** ![twentyoverten](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/twentyoverten/32/1919_2.png) [@twentyoverten](https://devforum.zoom.us/u/twentyoverten)\
**Post date:** [September 27, 2019, 9:17pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/9 "2019-09-27T21:17:42Z")

</div>

On the flipside @tommy I don’t see a 500 error from the webhook this time!

---

<div class="post-metadata">

**Author:** ![twentyoverten](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/twentyoverten/32/1919_2.png) [@twentyoverten](https://devforum.zoom.us/u/twentyoverten)\
**Post date:** [September 27, 2019, 9:42pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/11 "2019-09-27T21:42:25Z")

</div>

Did you see my other response above though @tommy?

---

<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 27, 2019, 10:17pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/12 "2019-09-27T22:17:20Z")

</div>

Yes I did @twentyoverten, currently debugging. I will get back to you asap.

Thanks,  
Tommy

---

<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 28, 2019, 1:08am UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/14 "2019-09-28T01:08:26Z")

</div>

Hey @twentyoverten, I was able to reproduce the error:

```json
{ code: 3001, message: 'Meeting ID is invalid or not end.' }

```

I think this is a bug in on our side, and I will have the team investigate.

As a work around, I tried using the webinar id instead of webinar uuid and it worked!

Try using the webinar id and let me know if you get the proper response! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![twentyoverten](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/twentyoverten/32/1919_2.png) [@twentyoverten](https://devforum.zoom.us/u/twentyoverten)\
**Post date:** [September 30, 2019, 3:16pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/15 "2019-09-30T15:16:17Z")

</div>

Thanks @tommy! Should I still be double URL encoding this when using the `ID`?

For what it’s worth I just tried again with the `UUID` still in place and it worked, but this was with the following `UUID` being double encoded (you’ll notice it doesn’t have any forward slashes, so unsure if this is just working properly because this instance didn’t have any by chance):

```auto
8vTMUilzTm2gfzOkoHT58w==

```

Let me know your thoughts!

---

<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 30, 2019, 3:24pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/16 "2019-09-30T15:24:11Z")

</div>

Happy to help @twentyoverten,

> [@twentyoverten](#):
>
> Should I still be double URL encoding this when using the `ID`

When just using the ID, you don’t have to double encode 🙂

> [@twentyoverten](#):
>
> For what it’s worth I just tried again with the `UUID` still in place and it worked, but this was with the following `UUID` being double encoded (you’ll notice it doesn’t have any forward slashes, so unsure if this is just working properly because this instance didn’t have any by chance)

Interesting! Double encoding the UUID should work with or without the forward slashes. I will debug this with our team. To confirm, does the double encoded UUID with slashes still not work?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![twentyoverten](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/twentyoverten/32/1919_2.png) [@twentyoverten](https://devforum.zoom.us/u/twentyoverten)\
**Post date:** [September 30, 2019, 4:29pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/17 "2019-09-30T16:29:38Z")

</div>

Thanks @tommy!

I’m not sure if it works with forward slashes + the double encoding, as the webinar I tested with didn’t return a UUID with a forward slash in it. I can test a few more times with other webinars to see if I get one with a forward slash to see if it works!

---

<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 30, 2019, 4:51pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/18 "2019-09-30T16:51:58Z")

</div>

Sounds good @twentyoverten!

I know we are working on removing the forward slashes in future generated UUIDs.

[Keep an eye on our change log for the release that has this fix.](https://marketplace.zoom.us/docs/changelog)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![hsintegration](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@hsintegration](https://devforum.zoom.us/u/hsintegration)\
**Post date:** [February 18, 2020, 6:03pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/20 "2020-02-18T18:03:45Z")

</div>

Hi @tommy!

I’m getting the same error on get webinar participants by UUID `OMh9UV3OSoe2tPRW//0xMw==`

```
https://api.zoom.us/v2/report/webinars/OMh9UV3OSoe2tPRW%2F%2F0xMw%3D%3D/participants?page_size=300

```

`Response {code=3001, message=Meeting ID is invalid or not end.}`

Is this caused by the same “slashes in the UUID” issue? If that’s the case, could you provide any fix ETA?

Thank you

---

<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:** [February 18, 2020, 6:14pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/21 "2020-02-18T18:14:11Z")

</div>

Hey @hsintegration,

This error means that the Webinar has not started yet.

Related post:

> [@Webinar Registrant - Name retrieval](https://devforum.zoom.us/t/webinar-registrant-name-retrieval/6746/6):
>
> Hey @priya.jetley, It looks like the Webinar (0126D4CB-67E4-4303-80CF-A5CD34D59372 \*ASbUy2fkQwOAz6XNNNWTcg==) has not been started yet. So the error message “Meeting ID is invalid or not end.” makes sense because the webinar has not happened. The [Dashboard APIs](https://marketplace.zoom.us/docs/api-reference/zoom-api/dashboards/dashboardwebinarparticipants) are for Live or Previous Webinars, and the [Reports APIs](https://marketplace.zoom.us/docs/api-reference/zoom-api/reports/reportwebinarparticipants) are for past webinars. Are you trying to get [Webinar Registrant](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarregistrants) Data before the webinar happens? Thanks, Tommy

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![hsintegration](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@hsintegration](https://devforum.zoom.us/u/hsintegration)\
**Post date:** [February 18, 2020, 6:26pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/22 "2020-02-18T18:26:34Z")

</div>

Hey @tommy,

The webinar is completed since I received “webinar.ended” event:

```
{ 
   event=WEBINAR_ENDED,
   payload={ 
      "account_id":"kNJh0JhMQeubQw_HwOPFZw",
      "object":{ 
         "duration":60,
         "start_time":"2020-02-06T18:00:21Z",
         "timezone":"America/Los_Angeles",
         "end_time":"2020-02-06T18:57:06Z",
         "topic":" ***redacted***",
         "id":"908639025",
         "type":5,
         "uuid":"OMh9UV3OSoe2tPRW//0xMw==",
         "host_id":"U6hCGa_rRuWSZVfzh55y7A"
      }
   } 

```

Also, I do see this webinar UUID when I hit `/past_webinars` endpoint.

---

<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:** [February 18, 2020, 8:06pm UTC](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050/23 "2020-02-18T20:06:44Z")

</div>

Hey @hsintegration,

Thanks for the details. This could also be happening if the Webinar was deleted after it finished.

Can you try calling the following endpoints with the same webinar uuid and let me know what response you get:

[https://marketplace.zoom.us/docs/api-reference/zoom-api/dashboards/dashboardwebinardetail](https://marketplace.zoom.us/docs/api-reference/zoom-api/dashboards/dashboardwebinardetail)  
[https://marketplace.zoom.us/docs/api-reference/zoom-api/reports/reportwebinardetails](https://marketplace.zoom.us/docs/api-reference/zoom-api/reports/reportwebinardetails)

Thanks,  
Tommy

[Next page](https://devforum.zoom.us/t/webhook-event-webinar-ended-continuing-to-return-500-error/6050.md?page=2)
