You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs). info

<br />


> [!NOTE]
> **Note:** Apigee Extensions are available in the Edge UI to Google Cloud Apigee customers with an Enterprise [support](https://cloud.google.com/apigee/pricing) plan.

> [!NOTE]
> **Note:** Extensions marked as deprecated will no longer be available for selection by users. However, the currently deployed version(s) will remain unaffected.

> [!CAUTION]
> **Caution:** This version of the extension is no longer supported and has been deprecated.

<br />

> Version 1.2.1

Insert rows into a BigQuery table. List rows from the table.

> [!NOTE]
> **Note:** Works only with tables. This extension does not support views.

## Prerequisites

This content provides reference for configuring and using this extension. Before using the extension from an API proxy using the [ExtensionCallout policy](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy), you must:

1. Ensure that you have enabled the BigQuery API for your account.

2. Ensure that you have created a BigQuery [dataset](https://cloud.google.com/bigquery/docs/datasets-intro) and [table](https://cloud.google.com/bigquery/docs/tables) (with [schema](https://cloud.google.com/bigquery/docs/schemas)) before attempting to insert rows.

3. [Use the GCP Console to generate a key for the service account](https://cloud.google.com/iam/docs/creating-managing-service-account-keys).

4. Use the contents of the resulting key JSON file when [adding and configuring](https://docs.apigee.com/api-platform/extensions/configuring-an-extension) the extension using the [configuration reference](https://docs.apigee.com/api-platform/reference/extensions/google-bigquery/google-bigquery-extension-121#configuration_reference).

## About Google BigQuery

[Google BigQuery](https://cloud.google.com/bigquery/) is a serverless, scalable enterprise data warehouse that enables super-fast SQL queries using the processing power of Google's infrastructure. Because there is no infrastructure to manage, you can focus on analyzing data to find meaningful insights using familiar SQL without the need for a database administrator.

For a hands-on introduction, try one of the [Google BigQuery quickstarts](https://cloud.google.com/bigquery/docs/quickstarts).

## Actions


> [!NOTE]
> **Note:** See the [ExtensionCallout policy](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy) for more information on setting [`<Action>`](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy#action_element), [`<Input>`](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy#input_element), and [`<Output>`](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy#output_element).

<br />

### insert

Insert a set of records as a dataset directly into BigQuery, with rows to be inserted and dataset/table ID.

### Syntax

    <Action>insert</Action>
    <Input><![CDATA[{
      "dataset" : dataset-to-insert,
      "table" : table-to-receive-data,
      "rows" : array-of-rows-to-insert
    }]]></Input>

### Example

    <Action>insert</Action>
    <Input><![CDATA[{
      "dataset" : "TestData",
      "table" : "TestTable",
      "rows" : [
        {"technology":"CRISPR","inventorFirstName":"Jennifer","inventorLastName":"Doudna"},
        {"technology":"World Wide Web","inventorFirstName":"Tim","inventorLastName":"Berners-Lee"}
        {"technology":"Alternating current","inventorFirstName":"Nikola","inventorLastName":"Tesla"}
      ]
    }]]></Input>

#### Request parameters

| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
| dataset | ID of the dataset to insert into BigQuery. | String | None. | Yes. |
| rows | Rows to insert into the table. | Array | None. | Yes. |
| table | Name of the table to receive the data. | String | None. | Yes. |

#### Response

None.

### listRows

Lists the rows in the table specified by the table ID and dataset ID.

### Syntax

    <Action>listRows</Action>
    <Input><![CDATA[{
      "dataset" : ID-of-dataset-to-examine,
      "limit" : maximum-rows-to-list,
      "startIndex" : row-index-at-which-to-start-list
      "table" : ID-of-table-to-examine
    }]]></Input>

### Example

    <Action>listRows</Action>
    <Input><![CDATA[{
      "dataset" : "TestData",
      "limit" : 2,
      "startIndex" : 1,
      "table" : "TestTable"
    }]]></Input>

#### Request parameters

| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
| dataset | ID of the dataset from which to list rows. | String | None. | Yes. |
| limit | Maximum number of rows to list. | Integer | None. | No. |
| startIndex | Row index at which to start the list. | Integer | None. | No. |
| table | ID of the table from which to list rows. | String | None. | Yes. |

#### Response

A `rows` array.

    {
      "rows": [
        {"technology":"World Wide Web","inventorFirstName":"Tim","inventorLastName":"Berners-Lee"}
        {"technology":"Alternating current","inventorFirstName":"Nikola","inventorLastName":"Tesla"}
      ]
    }

| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
| rows | Array of rows returned from the request. | Array | None. | Yes. |

## Configuration Reference

Use the following when you're configuring and deploying this extension for use in API proxies. For steps to configure an extension using the Apigee console, see [Adding and configuring an extension](https://docs.apigee.com/api-platform/extensions/configuring-an-extension).

> [!NOTE]
> **Note:** The ability to configure and deploy extensions is available only to organization administrators.

### Common extension properties

The following properties are present for every extension.

| Property | Description | Default | Required |
|---|---|---|---|
| `name` | Name you're giving this configuration of the extension. | None | Yes |
| `packageName` | Name of the extension package as given by Apigee Edge. | None | Yes |
| `version` | Version number for the extension package from which you're configuring an extension. | None | Yes |
| `configuration` | Configuration value specific to the extension you're adding. See [Properties for this extension package](https://docs.apigee.com/api-platform/reference/extensions/google-bigquery/google-bigquery-extension-121#properties_for_this_extension_package) | None | Yes |

### Properties for this extension package

Specify values for the following configuration properties specific to this extension.

| Property | Description | Default | Required |
|---|---|---|---|
| projectId | ID of the GCP project where the data. | None. | Yes. |
| credentials | When entered in the Apigee Edge console, this is the contents of your [service account key file](https://cloud.google.com/iam/docs/creating-managing-service-account-keys). When sent via the management API, it is a base64-encoded value generated from the service account key file. | None. | Yes. |