# The returned object on \`user-added\` event is of wrong type

**URL:** <https://devforum.zoom.us/t/the-returned-object-on-user-added-event-is-of-wrong-type/82825>\
**Category:** Web\
**Created:** [February 9, 2023, 1:29am UTC](https://devforum.zoom.us/t/the-returned-object-on-user-added-event-is-of-wrong-type/82825 "2023-02-09T01:29:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amalwa](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@amalwa](https://devforum.zoom.us/u/amalwa)\
**Post date:** [February 9, 2023, 1:29am UTC](https://devforum.zoom.us/t/the-returned-object-on-user-added-event-is-of-wrong-type/82825/1 "2023-02-09T01:29:19Z")

</div>

**Description**  
The `user-added` event gives the returned object as an array, rather than as JSON object.

**Browser Console Error**  
Trying to get the `user-id` results in `undefined` since the returned object is Array rather than object.

**Which Web Meeting SDK version?**  
2.9.7

**Meeting SDK Code Snippets**

```auto
zoomClient.on("user-added", async (payload) => {
      try {
        zoomClient.sendChat("hello-world", payload.userId);
      } catch (err) {
        console.error(err);
      }
    });

```

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [February 13, 2023, 9:24pm UTC](https://devforum.zoom.us/t/the-returned-object-on-user-added-event-is-of-wrong-type/82825/2 "2023-02-13T21:24:42Z")

</div>

Hi @amalwa  
Thanks for reaching out to the Zoom Developer Forum and welcome to our community!  
Could you please point me toward the documentation that you are using here so I can take a closer look into this?

Cheers,  
Elisa

---

<div class="post-metadata">

**Author:** ![amalwa](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@amalwa](https://devforum.zoom.us/u/amalwa)\
**Post date:** [March 10, 2023, 9:11pm UTC](https://devforum.zoom.us/t/the-returned-object-on-user-added-event-is-of-wrong-type/82825/3 "2023-03-10T21:11:28Z")

</div>

> [@elisa.zoom](#):
>
> Could you please point me toward the documentation that you are using here so I can take a closer look into this?

Hi Elisa,

Here is the documentation link - [https://marketplace.zoom.us/docs/sdk/native-sdks/web/component-view/reference/](https://marketplace.zoom.us/docs/sdk/native-sdks/web/component-view/reference/)

Essentially what the documentation says is that the event will contain a single `ParticipantPropertiesPayload`, however, its an `Array` of `ParticipantPropertiesPayload`.

---

<div class="post-metadata">

**Author:** ![amalwa](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@amalwa](https://devforum.zoom.us/u/amalwa)\
**Post date:** [March 10, 2023, 9:13pm UTC](https://devforum.zoom.us/t/the-returned-object-on-user-added-event-is-of-wrong-type/82825/4 "2023-03-10T21:13:22Z")

</div>

If you go into the documentation and navigate to `on` function, you will see that there is a event that customers can subscribe called - `"user-added"` which returns information about the user added to the meeting. The response payload is supposed to be an object but its actually an `Array`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [April 10, 2023, 7:13am UTC](https://devforum.zoom.us/t/the-returned-object-on-user-added-event-is-of-wrong-type/82825/5 "2023-04-10T07:13:30Z")

</div>

Closed on April 10, 2023, 7:13am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
