# Integrating 3rd Party Data Resources

1. [Step By Step](#id-1.-step-by-step)
2. [Demo Video](#id-2.-demo-video)

## 1. Step By Step

In order to integrate the data resources, we need to first configure "IntegrationButton" block. To get complete details, please check : [IntegrationButton](https://docs.hedera.com/guardian-dev-1/~/revisions/o57QY9WeuCWYIoDgpoV6/guardian/standard-registry/policies/policy-creation/introduction/integrationbutton-block) block section

Once the block configuration is completed, we need to follow the below steps:

### 1.1 Authentication Requirements <a href="#id-1.1-authentication-requirements" id="id-1.1-authentication-requirements"></a>

**Global Forest Watch:** You can review the documentation at <https://data-api.globalforestwatch.org/> for instructions on how to obtain an `x-api-key`, though please note by default the key comes with certain limitations. For full access, it is recommended to reach out directly to the company's partner team.

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FJZEmQBk97NIbQbQrAsmA%2Fimage.png?alt=media&#x26;token=0b83a641-d9bd-45ec-8423-75b98b3d16e0" alt=""><figcaption></figcaption></figure>

**Fire Information for Resource Management System**(**FIRMS):**

Access to FIRMS requires a `map_key`, which can be obtained via [this link](https://firms.modaps.eosdis.nasa.gov/api/map_key/). Please note that this key is subject to certain limitations. For unrestricted access, it is recommended to contact the FIRMS support team directly.

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FT6yjnUHhvfoJqizCDDwu%2Fimage.png?alt=media&#x26;token=c6279f5a-2b42-4d9c-86df-7da32679e87b" alt=""><figcaption></figcaption></figure>

**Kanop:**

1. **Register at:** <https://www.kanop.io/>
2. **Navigate to Application Settings:** <https://app.kanop.io/settings?tab=applications>
3. **Create a new application** to generate and obtain your access token.

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FwvSRYJ7i1kLiOqE3pDYr%2Fimage.png?alt=media&#x26;token=06e9913c-c890-4ce5-a792-662eed305b07" alt=""><figcaption></figcaption></figure>

### 1.2 API Documentation for Integrations <a href="#id-1.2-api-documentation-for-integrations" id="id-1.2-api-documentation-for-integrations"></a>

To explore request options and parameter details, refer to the documentation for each service:

1. [Global Forest Watch](https://data-api.globalforestwatch.org/)
2. [Kanop](https://main.api.kanop.io/projects/docs)
3. World Bank: <https://datahelpdesk.worldbank.org/knowledgebase/topics/125589> <https://datahelpdesk.worldbank.org/knowledgebase/articles/898581-api-basic-call-structures>
4. [FIRMS](https://firms.modaps.eosdis.nasa.gov/api/)

**For Kanop:**

The `KANOP_IO_AUTH_TOKEN` must be configured either in the **policy-service settings** or within the **Docker configuration**. Similarly, for FIRMS, the `FIRMS_AUTH_TOKEN` must be specified in the same locations. These tokens can be conveniently located under **Integration Tokens**.

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FP52oNY5iadNvXyfEkyLU%2Fimage.png?alt=media&#x26;token=8c016c8f-e7b7-4cae-a7b2-3d03ff932cc0" alt=""><figcaption></figcaption></figure>

**For Global Forest Watch:** You must set `GLOBAL_FOREST_WATCH_API_KEY` in the policy-service config or in the Docker configuration.

**For FIRMS:** The `FIRMS_AUTH_TOKEN` must be configured in the **policy-service settings** or within the **Docker configuration**.&#x20;

This token can be located under **Integration Tokens**.

### 1.3 Displaying Data in a Grid <a href="#id-1.3-displaying-data-in-a-grid" id="id-1.3-displaying-data-in-a-grid"></a>

To display the retrieved data in a grid, save the responses using the **`sendToGuardian`** block with the source set to either **auto** or **database**.

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FQm910rqAF0WGJfdA8GnE%2Fimage.png?alt=media&#x26;token=b20e5a5c-46f4-4e2c-ae2b-3f7cb8ecb622" alt=""><figcaption></figcaption></figure>

Use the `documents block` combined with the `source addon` block:

Set "Data type" to "Collection (VC)":

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2F3BnfCDaTUf9tyiI2Rxbk%2Fimage.png?alt=media&#x26;token=cf20945c-8de3-42ef-974e-64032d63f5b4" alt=""><figcaption></figcaption></figure>

Apply a filter: type = "integration"

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FtmNHVMiCGcZQuIM0ZwEu%2Fimage.png?alt=media&#x26;token=e809d1b9-e023-4fb1-8abe-449ec0a8705d" alt=""><figcaption></figcaption></figure>

### 1.4 Triggering Data Fetch <a href="#id-1.4-triggering-data-fetch" id="id-1.4-triggering-data-fetch"></a>

To retrieve data from a third-party source, select the **“Integration Data”** button. The system will execute the configured request and display the returned data.

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2FnVOgOph1aKhwzYwqCiaO%2Fimage.png?alt=media&#x26;token=90fa008a-cd2d-4228-95f1-0d31c0356832" alt=""><figcaption></figcaption></figure>

## 2. Demo Video <a href="#id-2.-demo-video" id="id-2.-demo-video"></a>

[Youtube](https://youtu.be/093Jh7qaiMM?si=lzfcvYLOZyJKhTd_\&t=132)
