# Get participants total duration and Actions Callbacks

**URL:** <https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075>\
**Category:** API and Webhooks\
**Created:** [December 14, 2019, 3:12pm UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075 "2019-12-14T15:12:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![darsh](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/darsh/32/2603_2.png) [@darsh](https://devforum.zoom.us/u/darsh)\
**Post date:** [December 14, 2019, 3:12pm UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075/1 "2019-12-14T15:12:27Z")

</div>

Hello;  
I’m building online training platform that involve 3 parties: Student, Trainer, Supervisors. I have already finished all stages and everything is working manually absolutely fine. I need to automate creating meetings and some reporting data between my project and Zoom services.  
I have read a lot in API documentation, but I still feel a little lost.  
Currently, I’m building my API calls based on the code by paezraphael in [https://github.com/paezraphael/sample-app-php](https://github.com/paezraphael/sample-app-php) suggested in [PHP SDK for REST API V2](https://devforum.zoom.us/t/php-sdk-for-rest-api-v2/3884/3) and I have 3 questions.

1- Is there a callback URL that I can set in my application or account to notify my system when participant joins or leave meeting? Current solution I have in mind - but I don’t think it’s very reliable one - is recursively getting meeting information until finding participant join and leave information.

2- I want to make joining meeting exclusive to Trainer, Teacher and supervisors. Is that possible? In case it is, what information should I have about users to do that? Eg. Zoom email address?  
Please note that I need attendance information for both Trainer and Teacher and in that case depending on Meeting Id and password won’t be reliable in my case since it can be shared by trainer for example and not allowing trainers to enter before host (Teacher) isn’t reliable as well since in case Teacher was absent I won’t be able to track if the student attended or not.

3- I’m trying to retrieve participants actual total duration during meeting.  
I found that /metrics/meetings/{meetingId}/participants shows the meeting participants join and leave time. But what happens in case the internet was disconnected from 1 of the participants for some time? Will that call show me total number of joining and leaving the meeting due to internet connection interruptions?

Best Regards

---

<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:** [December 16, 2019, 5:34pm UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075/2 "2019-12-16T17:34:57Z")

</div>

Hey @darsh, thanks for posting and using Zoom!

> [@darsh](#):
>
> 1- Is there a callback URL that I can set in my application or account to notify my system when participant joins or leave meeting? Current solution I have in mind - but I don’t think it’s very reliable one - is recursively getting meeting information until finding participant join and leave information.

Yes! Use our [Webhooks](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-webhook-only-app) or Event Subscriptions which can be added to [OAuth](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app#features) or [JWT](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-jwt-app#features) app types to be notified when a [Participant Joins](https://marketplace.zoom.us/docs/api-reference/webhook-reference/meeting-events/participant-joined-meeting), or [Leaves](https://marketplace.zoom.us/docs/api-reference/webhook-reference/meeting-events/participant-left) a meeting.

> [@darsh](#):
>
> 2- I want to make joining meeting exclusive to Trainer, Teacher and supervisors. Is that possible? In case it is, what information should I have about users to do that? Eg. Zoom email address?  
> Please note that I need attendance information for both Trainer and Teacher and in that case depending on Meeting Id and password won’t be reliable in my case since it can be shared by trainer for example and not allowing trainers to enter before host (Teacher) isn’t reliable as well since in case Teacher was absent I won’t be able to track if the student attended or not.

For limiting who can and cannot join a meeting, implement [meeting registration](https://support.zoom.us/hc/en-us/articles/211579443-Registration-for-Meetings). This can be done on the Zoom Web Portal, or via our API). When a [user registers](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate), you can check your backend if that user is a Trainer, Teacher, or Supervisor, [then respectively approve or deny them to be in the meeting](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantstatus).

> [@darsh](#):
>
> 3- I’m trying to retrieve participants actual total duration during meeting.  
> I found that /metrics/meetings/{meetingId}/participants shows the meeting participants join and leave time. But what happens in case the internet was disconnected from 1 of the participants for some time? Will that call show me total number of joining and leaving the meeting due to internet connection interruptions?

If the participant is discounted due to internet issues, the `leave_time` will reflect correctly, as well as the `leave_reason` stating why the participant left, for example: “Internet Issues”.

Let me know if you have any other questions! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![darsh](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/darsh/32/2603_2.png) [@darsh](https://devforum.zoom.us/u/darsh)\
**Post date:** [December 17, 2019, 2:18pm UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075/3 "2019-12-17T14:18:06Z")

</div>

Hey @tommy, thank you very much for your answers.  
I could find a way using OAuth to get users information to register their user Ids in my database and use it later for meetings registration as suggested by you.  
I have another question if you let me. Is there a way to allow individuals to connect their accounts using JWT application, or is it exclusive feature for OAuth application?  
Currently I’m using OAuth for connecting users (Registering their user Ids in my database) and JWT to manage my own account (Meetings registration, Reports … etc ).  
Is that alright?  
I will post code used in callback page (redirect\_uri) in case someone else needs it.

> ```
> if(isset($_REQUEST['code']))
> {
> 
> ```
> 
> $code = $\_REQUEST[‘code’];  
> $token\_url = ‘[https://zoom.us/oauth/token?grant\_type=authorization\_code&code=‘.$code.’&redirect\_uri=](https://zoom.us/oauth/token?grant_type=authorization_code&code='.$code.'&redirect_uri=)’.urlencode($redirect\_uri);  
> $options = array(  
> ‘http’ =\> array(  
> ‘header’ =\> "Authorization: Basic ".base64\_encode($client\_id.‘:’.$client\_secret),  
> ‘method’ =\> ‘POST’  
> )  
> );  
> $context = stream\_context\_create($options);  
> $reponse = file\_get\_contents($token\_url, false, $context);  
> $params = json\_decode($reponse);  
> $access\_token = $params-\>access\_token;  
> $user\_url = ‘[https://api.zoom.us/v2/users/me?access\_token=](https://api.zoom.us/v2/users/me?access_token=)’.$access\_token;  
> $reponse = file\_get\_contents($user\_url);  
> $user = json\_decode($reponse);  
> var\_dump($user);

---

<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:** [December 17, 2019, 5:09pm UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075/4 "2019-12-17T17:09:07Z")

</div>

Hey @darsh, happy to help!

> [@darsh](#):
>
> Is there a way to allow individuals to connect their accounts using JWT application, or is it exclusive feature for OAuth application?

You can only access your Zoom account, or other users on your Zoom account with a [JWT App](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-jwt-app). In order for people outside your Zoom account to use your application, you need to use an [OAuth App](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app).

> [@darsh](#):
>
> Currently I’m using OAuth for connecting users (Registering their user Ids in my database) and JWT to manage my own account (Meetings registration, Reports … etc ).  
> Is that alright?

Yes that is perfectly fine!

Let me know if you have any other questions! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![darsh](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/darsh/32/2603_2.png) [@darsh](https://devforum.zoom.us/u/darsh)\
**Post date:** [December 17, 2019, 5:55pm UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075/5 "2019-12-17T17:55:24Z")

</div>

Thank you @tommy for your answers. I really appreciate it.

> [@tommy](#):
>
> If the participant is discounted due to internet issues, the `leave_time` will reflect correctly, as well as the `leave_reason` stating why the participant left, for example: “Internet Issues”.

I understood that if you participant got disconnected so leave time will be updated. But what if participant was connected again then 5 minutes later he was reconnected then 10 minutes later he got disconnected again.  
Will all these data be included in participant data when I call /metrics/meetings/{meetingId}/participants or in this case events subscriptions will be best solution?

---

<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:** [December 17, 2019, 6:44pm UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075/6 "2019-12-17T18:44:07Z")

</div>

Hey @darsh, you are welcome!

> [@darsh](#):
>
> I understood that if you participant got disconnected so leave time will be updated. But what if participant was connected again then 5 minutes later he was reconnected then 10 minutes later he got disconnected again.  
> Will all these data be included in participant data when I call /metrics/meetings/{meetingId}/participants or in this case events subscriptions will be best solution?

If this happens, then you will see a separate record for each time the participant joined/left. For example when I had the same user join / leave, then join / leave again, there are two records for the user with the same id: `88CCc8_KQNebfLX7rvnFwQ`:

```json
{
    "page_count": 1,
    "page_size": 30,
    "total_records": 3,
    "next_page_token": "",
    "participants": [
        {
            "id": "{REDACTED}",
            "user_id": "{REDACTED}",
            "user_name": "Tommy",
            "device": "Web",
            "ip_address": "{REDACTED}",
            "location": "{REDACTED}",
            "network_type": "Others",
            "microphone": "wclaudi",
            "camera": "webcam",
            "data_center": "{REDACTED}",
            "connection_type": "UDP",
            "join_time": "2019-12-17T18:32:13Z",
            "leave_time": "2019-12-17T18:33:38Z",
            "share_application": false,
            "share_desktop": false,
            "share_whiteboard": false,
            "recording": false,
            "pc_name": "",
            "domain": "",
            "mac_addr": "",
            "harddisk_id": "",
            "version": "4.0.426.1118.ffde97c8",
            "leave_reason": "Tommy left the meeting.<br>Reason: Host ended the meeting."
        },
        {
            "id": "{REDACTED}",
            "user_id": "{REDACTED}",
            "user_name": "Tommy 1",
            "device": "Mac",
            "ip_address": "{REDACTED}",
            "location": "{REDACTED}",
            "network_type": "Wifi",
            "microphone": "MacBook Pro Microphone (MacBook Pro Microphone)",
            "speaker": "MacBook Pro Speakers (MacBook Pro Speakers)",
            "camera": "HD Pro Webcam C920 #2",
            "data_center": "DV (Top)",
            "connection_type": "UDP",
            "join_time": "2019-12-17T18:32:33Z",
            "leave_time": "2019-12-17T18:32:54Z",
            "share_application": false,
            "share_desktop": false,
            "share_whiteboard": false,
            "recording": false,
            "pc_name": "Tommy MacBook Pro",
            "domain": "Tommy--MacBook-Pro",
            "mac_addr": "{REDACTED}",
            "harddisk_id": "{REDACTED}",
            "version": "4.6.13614.1202",
            "leave_reason": "Tommy 1 left the meeting.<br>Reason: left the meeting."
        },
        {
            "id": "{REDACTED}",
            "user_id": "{REDACTED}",
            "user_name": "Tommy 2",
            "device": "Mac",
            "ip_address": "{REDACTED}",
            "location": "{REDACTED}",
            "network_type": "Wifi",
            "microphone": "MacBook Pro Microphone (MacBook Pro Microphone)",
            "speaker": "MacBook Pro Speakers (MacBook Pro Speakers)",
            "camera": "HD Pro Webcam C920 #2",
            "data_center": "DV (Top)",
            "connection_type": "UDP",
            "join_time": "2019-12-17T18:33:02Z",
            "leave_time": "2019-12-17T18:33:33Z",
            "share_application": false,
            "share_desktop": false,
            "share_whiteboard": false,
            "recording": false,
            "pc_name": "Tommy MacBook Pro",
            "domain": "Tommy-MacBook-Pro",
            "mac_addr": "{REDACTED}",
            "harddisk_id": "{REDACTED}",
            "version": "4.6.13614.1202",
            "leave_reason": "Tommy 2 left the meeting.<br>Reason: left the meeting."
        }
    ]
}

```

If you want this data in real time, [without exceeding rate limits](https://marketplace.zoom.us/docs/api-reference/rate-limits), I would suggest using the Participant [Join](https://marketplace.zoom.us/docs/api-reference/webhook-reference/meeting-events/participant-joined-meeting) / [Left](https://marketplace.zoom.us/docs/api-reference/webhook-reference/meeting-events/participant-left) Meeting Webhooks.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![aac](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aac/32/9277_2.png) [@aac](https://devforum.zoom.us/u/aac)\
**Post date:** [May 27, 2020, 2:37am UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075/7 "2020-05-27T02:37:02Z")

</div>

Apologes for resurrecting a old post but this is nearly the only result on google for the information below.

Any Zoom participant shown as using a microphone “wclaudi” wclaudi in the meeting dashboard used Chrome within Windows 10 Sandbox. See here for more information - hope this helps.

> **[Windows Sandbox](https://techcommunity.microsoft.com/t5/windows-kernel-internals/windows-sandbox/ba-p/301849)**
>
> Windows Sandbox is a new lightweight desktop environment tailored for safely running applications in isolation.   How many times have you downloaded an executable file, but were afraid to run it? Have you ever been in a situation which required...

Their local IP should also be a Class A / 10.x.x.x address, this is the virtual ethernet adaptor within the Sandbox.

---

<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:** [June 1, 2020, 9:16pm UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075/8 "2020-06-01T21:16:02Z")

</div>

Thanks for sharing this @aac! 🙂

-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, 9:39pm UTC](https://devforum.zoom.us/t/get-participants-total-duration-and-actions-callbacks/7075/9 "2020-08-21T21:39:15Z")

</div>

Closed on August 21, 2020, 9:39pm UTC


