Getting zoom activity sign in/out logs

Using this template helps us debug your issues more effectively :slight_smile:

Description
Newbie to API’s, trying to get the above info in to our QRadar SEIM platform which does support a Cloud REST API.

Error
It appears I need to use pagination, but that newbie thing is stopping me.

Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT

Which Endpoint/s?
https://api.zoom.com/v2/report.activities

I think I just need help with how to add pagination code to this, which someone else wrote:

<?xml version="1.0" encoding="UTF-8" ?>
<Parameters>
    <Parameter name="host" label="Host" required="true" default="api.zoom.us" />
    <Parameter name="api_key" label="API Key" required="true" />
    <Parameter name="api_secret" label="API Secret" required="true" secret="true" />
</Parameters>

<Actions>

    <!-- Initialize the Bookmark -->
    <Initialize path="/bookmark" value="1970-01-01" />

    <!-- Create an Access Token -->
    <CreateJWTAccessToken savePath="/access_token">
        <Header>
            <Value name="alg" value="HS256" />
            <Value name="typ" value="JWT" />
        </Header>
        <Payload>
            <Value name="iss" value="${/api_key}" />
        </Payload>
        <Secret value="${/api_secret}" />
    </CreateJWTAccessToken>

    <!-- Fetch Events -->
    <CallEndpoint url="https://${/host}/v2/report/activities" method="GET" savePath="/get_events">
        <BearerAuthentication token="${/access_token}" />
        <QueryParameter name="from" value="${/bookmark}" omitIfEmpty="true" />
<QueryParameter name="page_size" value="300" />
    </CallEndpoint>

    <!-- Handle Errors -->
    <If condition="/get_events/status_code != 200">
        <Abort reason="${/get_events/body/code}: ${/get_events/body/message}" />
    </If>

    <!-- Post Events, if any -->
    <If condition="count(/get_events/body/activity_logs) > 0">

        <PostEvents path="/get_events/body/activity_logs" source="${/host}" />

        <!-- Update the bookmark -->
        <ParseDate pattern="yyyy-MM-dd'T'HH:mm:ss'Z'" timeZone="UTC" date="${max(/get_events/body/activity_logs/time)}" savePath="/last_event_time" />
        <FormatDate pattern="yyyy-MM-dd" timeZone="UTC" time="${/last_event_time + 86400000}" savePath="/bookmark" />

    </If>

</Actions>

<Tests>
    <DNSResolutionTest host="${/host}" />
    <TCPConnectionTest host="${/host}" />
    <SSLHandshakeTest host="${/host}" />
    <HTTPConnectionThroughProxyTest url="https://${/host}" />
</Tests>

Hey @bryanscu,

It sounds like you’re calling our GET Sign In/Sign Out activity endpoint, right?

I recommend setting the page_size to value of 300:
GET https://api.zoom.us/v2/report/activities?page_size=300

If there are more than 300 records to return, the JSON API response will include a next_page_token value. You will need to copy that and make a subsequent request that includes this in the request URL, such as:
GET https://api.zoom.us/v2/report/activities?page_size=300&next_page_token={tokenValue}

This will then return the next page of records.

Let me know if this helps—thanks!
Will