# Collect data from Dropbox

## Overview

Get a list of event streams from Dropbox.

## Configuration

### Parameters

* `parameters.domain` will store the value of the API URL, excluding the endpoint paths like `/oauth2/token` or `/2/team_log/get_events`

<figure><picture><source srcset="/files/keEw1bKbwb7Uqx9nPpJG" media="(prefers-color-scheme: dark)"><img src="/files/ztmoP8JznVckDOFSi69B" alt=""></picture><figcaption></figcaption></figure>

### Secrets

* `refresh_token`will reference the [Dropbox refresh token](https://pages.cs.link/prod/zscaler_block?url=https%3a%2f%2fdevelopers%2edropbox%2ecom%2foauth%2dguide\&referer=https%3a%2f%2fwww%2egoogle%2ecom%2f\&reason=Request+method+not+allowed+for+category+Personal+Use\&reasoncode=METHOD_DENIED\&timebound=1\&action=deny\&kind=category\&rule=1273379\&cat=Personal+Use\&user=sarah.bigault@crowdstrike.com\&locid=00000000\&lang=en_US\&zsq=0N0P65MHf00T5nJWPjF6sfJRsrJ46sq5HnVqJKQzsq).
* `secrets.client_id` will reference the Client ID
* `secrets.client_secret` will reference the Client Secret.

<figure><picture><source srcset="/files/S8ABxP8tUKf3ANdeOpu2" media="(prefers-color-scheme: dark)"><img src="/files/15NY4j0NrEmuvGigkrIY" alt=""></picture><figcaption></figcaption></figure>

To add a Secret, open the **Secret** fields and click **New secret**:

* Give the secret a **Name**.
* Turn off the **Expiration date** option.
* Click **Add new value** and paste the secret corresponding to the value.
* Click **Save**.

<figure><picture><source srcset="/files/NeeWsSQzoChVxRIY76Nt" media="(prefers-color-scheme: dark)"><img src="/files/1oTccyPmgZJ1laY7IhZH" alt=""></picture><figcaption></figcaption></figure>

{% hint style="info" %}
Learn more about secrets in Onum in [this article](/administration/global-settings/organization-settings/secrets-management.md).
{% endhint %}

You can now select the secret you just created in the corresponding fields.

After entering the required parameters and secrets, you can choose to manually enter the Falcon API **Alerts** fields, or simply paste the given YAML:

{% tabs %}
{% tab title="Config as YAML" %}
Toggle this **ON** to enable a free text field where you can paste your **CrowdStrike Falcon API** YAML.

```yaml
withTemporalWindow: true
temporalWindow:
  duration: 5m
  offset: 5m
  tz: UTC
  format: RFC3339
withAuthentication: true
authentication:
  type: token
  token:
    request:
      method: POST
      url: https://${parameters.domain}/oauth2/token
      headers:
        - name: Content-Type
          value: application/x-www-form-urlencoded
      bodyType: urlEncoded
      bodyParams:
        - name: grant_type
          value: refresh_token
        - name: refresh_token
          value: '${secrets.refresh_token}'
        - name: client_id
          value: '${secrets.client_id}'
        - name: client_secret
          value: '${secrets.client_secret}'
    tokenPath: ".access_token"
    authInjection:
      in: header
      name: Authorization
      prefix: 'Bearer '
      suffix: ''
withEnumerationPhase: false
collectionPhase:
  paginationType: "cursor"
  cursorSelector: ".cursor"
  initialRequest:
    method: POST
    url: "https://${parameters.domain}/2/team_log/get_events"
    headers:
      - name: Content-Type
        value: application/json
    bodyType: raw
    bodyRaw: |
      {
        "time": {
            "start_time": "${temporalWindow.from}",
            "end_time": "${temporalWindow.to}"
        }
      }
  nextRequest:
    method: POST
    url: "https://${parameters.domain}/2/team_log/get_events/continue"
    headers:
      - name: Content-Type
        value: application/json
    bodyRaw: |
      {
        "cursor": "${pagination.cursor}" 
      }
  output:
    select: ".events"
    map: "."
    outputMode: element
```

{% endtab %}

{% tab title="Manually configure" %}
**Temporal Window**

Toggle **ON** to add a temporal window for events. This repeatedly shifts the time window over which data is collected.

* **Duration -** 5 minutes (`5m`) as default, adjust based on your needs.
* **Offset -** `5m`
* **Format** - `RFC3339`

**Authentication Phase**

Toggle **ON** to configure the authentication phase. This is required to get the token to pull data using **OAuth**.

* **Type**<mark style="color:red;">**\***</mark>**&#x20;-** `token`
* **Request Method**<mark style="color:red;">**\***</mark>**&#x20;-** `POST`&#x20;
* **URL**<mark style="color:red;">**\***</mark>**&#x20;-** `${parameters.domain}/oauth2/token`
* **Headers**&#x20;
  * **Name** - `Content-type`
  * **Value** - `application/x-www-form-urlencoded`
* **BodyType**<mark style="color:red;">**\***</mark> - `UrlEncoded`
  * **Body params**
    * **Name -** `grant_type`
    * **Value -** `refresh_token`
    * **Name -** `refresh_token`
    * **Value -**`${secrets.refresh_token}`
    * **Name -** `client_id`
    * **Value -**  `${secrets.client_id}`
    * **Name -** `client_secret`
    * **Value -** `${secrets.client_secret}`
* **Token Path**<mark style="color:red;">**\***</mark> - `.access_token`
* **Auth Injection**
  * **In**<mark style="color:red;">**\***</mark> - `header`
  * **Name**<mark style="color:red;">**\***</mark> - `authorization`
  * **Prefix** - `Bearer`
  * **Suffix** - `''`

**Enumeration Phase**

**OFF**

**Collection Phase**&#x20;

* **Pagination Type**<mark style="color:red;">**\***</mark>**&#x20;-** `cursor`
* **Cursor** - `.cursor`
* **Cursor Selector -** `.cursor`
* **Initial Request**&#x20;
  * **Method**<mark style="color:red;">**\***</mark>**&#x20;-** `POST`
  * **URL**<mark style="color:red;">**\***</mark>**&#x20;-** `https://${parameters.domain}/2/team_log/get_events`
  * **Headers -**&#x20;
    * **Name** - `Content-Type`
    * **Value -** `application/json` &#x20;
  * **Body Type -** `raw`
  * **Body Raw -** `|`\
    `{`\
    `"time": {`\
    `"start_time": "${temporalWindow.from}",`\
    `"end_time": "${temporalWindow.to}"`\
    `}`\
    `}`
* **Next Request**&#x20;
  * **Method**<mark style="color:red;">**\***</mark>**&#x20;-** `POST`
  * **URL**<mark style="color:red;">**\***</mark>**&#x20;-** `https://${parameters.domain}/2/team_log/get_events/continue`
  * **Headers -**&#x20;
    * **Name** - `Content-Type`
    * **Value -** `application/json` &#x20;
  * **Body Type -** `raw`
  * **Body Raw -** `|`\
    `{`\
    `"cursor": "${pagination.cursor}"`\
    `}`
* **Output**&#x20;
  * **Select -** `.events`
  * **Map -** `.`
  * **Output Mode** - `element`
    {% endtab %}
    {% endtabs %}

This HTTP Pull Listener now uses the business API to extract events.&#x20;

Click **Create labels** to move on to the next step and define the required [Labels](/the-workspace/listeners/labels.md) if needed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onum.com/the-workspace/listeners/listener-integrations/pull-data-from-http-endpoints/collect-data-from-dropbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
