# Get Active Host report request not returning all data

**URL:** <https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600>\
**Category:** API and Webhooks\
**Created:** [October 18, 2020, 9:54pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600 "2020-10-18T21:54:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![aarthur](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aarthur/32/17270_2.png) [@aarthur](https://devforum.zoom.us/u/aarthur)\
**Post date:** [October 18, 2020, 9:54pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/1 "2020-10-18T21:54:36Z")

</div>

My request to get an active host report (within a 1 day timeframe) isn’t returning all data. I’m using google script editor to store the data in a worksheet.

I’m not receiving an error message. Has anyone come across this issue before?

```
function getZoomMinutes() {

```

// Declaring variables  
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[2];  
var input = sheet.getRange(“A2”);  
var cols = sheet.getRange(“A:C”);  
var token = getJWT(apiKey, apiSecret);  
var user = 0;

// Date variables  
var date = new Date();  
date.setDate(date.getDate() - 1);  
var day = date.getDate();  
var month = date.getMonth() + 1;  
var year = date.getFullYear();

// URL required for API call  
var url = ‘[https://api.zoom.us/v2/report/users?from=](https://api.zoom.us/v2/report/users?from=)’ + year + ‘-’ + month + ‘-’ + day + ‘T00:00:00Z&to=’ + year + ‘-’ + month + ‘-’ + day + ‘T23:59:59Z&type=active&page\_size=300’;

// API parameters  
var headers = {  
‘Authorization’: ‘Bearer’ + token + ’ ’  
};  
var params = {  
headers: headers  
};

// Making API call and parsing JSON response  
var response = UrlFetchApp.fetch(url, params);  
var zoomData = JSON.parse(response);  
var numUsers = zoomData.total\_records;

// Clearing existing data  
cols.clear();  
sheet.getRange(“A1”).setValue(“Email”)  
sheet.getRange(“B1”).setValue(“Talk Time”)  
sheet.getRange(“C1”).setValue(“Date”)

// Looping through records returned and writing to the Google Sheet  
for(user = 0; user \< numUsers; user++) {  
input.offset(user, 0).setValue(zoomData.users[user].email);  
input.offset(user, 1).setValue((zoomData.users[user].meeting\_minutes/zoomData.users[user].participants)\*zoomData.users[user].meetings);  
input.offset(user, 2).setValue(month + “/” + day + “/” + year);  
user++;  
}

} // END GetZoomMinutes FUNCTION

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 19, 2020, 8:53pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/2 "2020-10-19T20:53:04Z")

</div>

Hey @aarthur,

Thanks for joining our developer community—I’m happy to take a closer look at this for you!

Is it possible to share the full request URL you’re using (with the variable values included) with me here, as well as what you’re expecting to see in the response but aren’t? This will help me look into it for you.

Thanks!  
Will

---

<div class="post-metadata">

**Author:** ![aarthur](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aarthur/32/17270_2.png) [@aarthur](https://devforum.zoom.us/u/aarthur)\
**Post date:** [October 20, 2020, 6:37pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/3 "2020-10-20T18:37:14Z")

</div>

Hi Will,

Thanks for your help! Here is the full request URL:

[https://api.zoom.us/v2/report/users?from=2020-10-19T00:00:00Z&to=2020-10-19T23:59:59Z&type=active&page\_size=300](https://api.zoom.us/v2/report/users?from=2020-10-19T00:00:00Z&to=2020-10-19T23:59:59Z&type=active&page_size=300)

Here’s what the response should be: [https://drive.google.com/file/d/1sswR1KR0XLHyubtucNbZTiK9vIfUelFF/view?usp=sharing](https://drive.google.com/file/d/1sswR1KR0XLHyubtucNbZTiK9vIfUelFF/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![aarthur](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aarthur/32/17270_2.png) [@aarthur](https://devforum.zoom.us/u/aarthur)\
**Post date:** [October 20, 2020, 6:37pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/4 "2020-10-20T18:37:46Z")

</div>

And here’s what I’m currently getting: [https://drive.google.com/file/d/1D9kY9JH6u-5SPyI-qpW9JvkZ1Lo\_fcKZ/view?usp=sharing](https://drive.google.com/file/d/1D9kY9JH6u-5SPyI-qpW9JvkZ1Lo_fcKZ/view?usp=sharing)

I’m getting 131 unique users when I should get 262.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 21, 2020, 3:21pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/5 "2020-10-21T15:21:53Z")

</div>

Hi @aarthur,

I see—thank you for providing these details!

I believe that the issue here is a result of the value you’re passing for the to/from fields. This API endpoint supports `date`, not technically `date-time` which you appear to be passing:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/c/0/c0093ff89976ec45d333521250d08b660968ae93.png)

You will need to set the `to` parameter to at least the next day in order to capture all potential activity.

I hope this helps to clarify, but let me know if you have questions about this.

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![aarthur](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aarthur/32/17270_2.png) [@aarthur](https://devforum.zoom.us/u/aarthur)\
**Post date:** [October 22, 2020, 2:14pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/6 "2020-10-22T14:14:05Z")

</div>

@will.zoom I tested these changes and there was no difference in the outcome. Each time I run a test, I get exactly half of the number of unique users as is the expected outcome. Does this indicate any particular problem to you?

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 23, 2020, 2:01pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/7 "2020-10-23T14:01:04Z")

</div>

Hey @aarthur,

Can you share the request/response you get after using `date` and adding at least a day to your `to`/`from` parameters?

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![aarthur](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aarthur/32/17270_2.png) [@aarthur](https://devforum.zoom.us/u/aarthur)\
**Post date:** [October 27, 2020, 4:10pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/8 "2020-10-27T16:10:05Z")

</div>

@will.zoom Yes, here are those results: [https://docs.google.com/spreadsheets/d/1t-vMy0XsmxsBi1EP5b3XUL2hEahgBjNtTqLhDsIfTHs/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1t-vMy0XsmxsBi1EP5b3XUL2hEahgBjNtTqLhDsIfTHs/edit?usp=sharing)

I made an adjustment to the code since I last spoke with you and now I’m getting 150 unique users, which is more than before, but still not the amount I should see, 262.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 28, 2020, 4:36pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/9 "2020-10-28T16:36:06Z")

</div>

Hi @aarthur,

Thanks for sharing that. Can you add the page\_number parameter to your requests and let me know if you’re getting the full results when passing additional page numbers (e.g.,page\_number=1, page\_number=2,etc.)?

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![aarthur](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aarthur/32/17270_2.png) [@aarthur](https://devforum.zoom.us/u/aarthur)\
**Post date:** [October 28, 2020, 5:47pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/10 "2020-10-28T17:47:41Z")

</div>

Oh it was my understanding that page number parameters were unnecessary and that the response should include all records on each page. Is that not the case?

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 29, 2020, 6:57pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/11 "2020-10-29T18:57:51Z")

</div>

Hi @aarthur,

If the number of total records exceeds the page size, you’ll need to page through the results. While this may not necessarily be the case for your request, I did want to rule it out. Let me know if this makes a difference!

Best,  
Will

---

<div class="post-metadata">

**Author:** ![aarthur](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aarthur/32/17270_2.png) [@aarthur](https://devforum.zoom.us/u/aarthur)\
**Post date:** [November 17, 2020, 2:50pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/12 "2020-11-17T14:50:42Z")

</div>

Would you be able to provide or point me toward an example of utilizing pagination in a case like this? I’m hoping to get something more detailed than the Zoom API reference guide for pagination.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [November 18, 2020, 8:45pm UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/13 "2020-11-18T20:45:38Z")

</div>

Hey @aarthur,

Depending on where your requests are being initiated from this could vary based on framework/language, but generally speaking you will want to have some kind of loop function that follows this kind of pattern:

Request 1:  
`https://api.zoom.us/v2/report/users?from=2020-10-19T00:00:00Z&to=2020-11-19T23:59:59Z&type=active&page_size=1`

Response 1:

```auto
{
    "from": "2020-10-19",
    "to": "2020-11-18",
    "page_count": 2,
    "page_number": 1,
    "page_size": 1,
    "total_records": 2,
    "next_page_token": "MUvnrzuUn5yVht6gCPttr36hMR08vgqcxt2",
    "total_meetings": 7,
    "total_participants": 19,
    "total_meeting_minutes": 174,
    "users": [
        {
            "id": "4p4h3VhUQg-9 ********",
            "email": "someone@example.com",
            "user_name": "someone",
            "type": 2,
            "dept": "",
            "meetings": 1,
            "participants": 2,
            "meeting_minutes": 113,
            "last_client_version": "5.0.24030.0508(mac)",
            "last_login_time": "2020-10-23T16:57:27Z",
            "create_time": "2020-09-01T13:50:37Z"
        }
    ]
}

```

Grab the `next_page_token` from response 1, save as a variable to pass as parameter in request 2.

Request 2:  
`https://api.zoom.us/v2/report/users?from=2020-10-19T00:00:00Z&to=2020-11-19T23:59:59Z&type=active&page_size=1&next_page_token=MUvnrzuUn5yVht6gCPttr36hMR08vgqcxt2`

Response 2:

```auto
{
    "from": "2020-10-19",
    "to": "2020-11-18",
    "page_size": 1,
    "total_records": 2,
    "next_page_token": "",
    "total_meetings": 7,
    "total_participants": 19,
    "total_meeting_minutes": 174,
    "users": [
        {
            "id": "NXRlnQhwQ ********",
            "email": "another_someone@example.com",
            "user_name": "Another someone",
            "type": 2,
            "dept": "60",
            "meetings": 6,
            "participants": 17,
            "meeting_minutes": 61,
            "last_client_version": "5.1.28642.0705(iphone)",
            "last_login_time": "2020-11-16T15:21:09Z",
            "create_time": "2020-03-25T20:11:37Z"
        }
    ]
}

```

And so on…

I hope this helps!

Best,  
Will

---

<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:** [December 19, 2020, 6:45am UTC](https://devforum.zoom.us/t/get-active-host-report-request-not-returning-all-data/33600/14 "2020-12-19T06:45:39Z")

</div>

Closed on December 19, 2020, 6:45am UTC

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