cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, My overall goal is to use the API to come up with monthly usage data for the top 20 users. I have connected to the API and am seeing data returned but with discrepancies.

Hello, My overall goal is to use the API to come up with monthly usage data for the top 20 users. I have connected to the API and am seeing data returned but with discrepancies.

jludt
New Contributor

I'm using the following method in Postman to yield results for what I believe to be the same time range as the HiveManager report I'm comparing to. From there I'm searching the API results for a corresponding username from that report and adding up the usage. Are the usage results in the API in bytes? Should I be going about trying to do this in another way?

 

https://hmng-prod-va2-cm-01.aerohive.com/xapi/v1/monitor/clients?ownerId=****&startTime=2018-11-25T00:00:00.000Z&endTime=2018-12-02T23:59:00.000Z&timeUnit=DAY&page=0&pageSize=100000

11 REPLIES 11

jludt
New Contributor

Brian - there definitely looks like a discrepancy. And after looking further into the data in the Top Usage widget we're not even sure how accurate of a representation that is. It seems like the usage there is overstated Do you know how that data is gathered to be displayed on that Top Usage widget? I would also be curious to hear your thoughts on why the data in that Top Usage widget does not match up to what is being displayed under Monitor->Clients when both are set to pull from users and the same time frame. While the monitoring appears to be more real time it does offer a historical option which I would assume should match up when looking at say a previous day.

AnonymousM
Valued Contributor II

I just wanted to clarify that you are seeing discrepancies between the client usage shown in the "Top Usage" widget and the API responses (as opposed to the users' usage). If you are seeing that the client usage differs, how long does it take for the client usage shown in the "Top Usage" to diverge from the result returned by your API requests? I would like to know this to determine whether we should first investigate whether the data you are getting back from the API requests is incorrect or if we just need to focus on the method used to calculate the users' usage.

jludt
New Contributor

Hi Brian - thanks for the clarification on the usage metric. In regards to the API response and the "Top Usage" widget I can tell you the two most definitely do not match up. The results I'm seeing in the API match up to the Historical data found under Monitor->Clients. If I set that to show for the last 24 hours and then call the API for that same time range I see usage data match up consistently. So I'm not sure how that Top Usage widget is being populated but it appears to be doing something differently than what that is being returned via any of the API calls. And since there is no way to get a report of monthly usage by users I would still be interested in knowing whether there is any way to do this via API so please let me know if you have any other thoughts or questions for me on this.

Thanks again

AnonymousM
Valued Contributor II

The usage returned in the JSON response to your API request is given in bytes. You should be able to use the endpoint you referenced above to retrieve the client usage for the specified time range. You mentioned above that you saw discrepancies between the usage shown for users in reports and the usage calculations you made by summing client usage where usernames matched in order to obtain usage for users. I would like to know if you are seeing any discrepancies between the client usage you see in the reports and the JSON responses from your API requests. Could you test whether the client usage that is being reported by the API request matches in the "Top Usage" widget?

GTM-P2G8KFN