You can connect to Tinybird using Retool's REST API integration and make it available as a resource. Once complete, you can write queries to interact with the Tinybird API.
Requirements
All users for Retool organizations on Free or Team plans have global Edit permissions and can add, edit, and remove resources. If your organization manages user permissions for resources, you must be a member of a group with Edit all permissions.
To create your Tinybird resource, you need:
- REST API connection details.
- A valid API key.
Tinybird has two authentication options. You can use Bearer (token) authentication or you can pass the token in a URL parameter. Either way, you must provide an API key or access token for Retool to authorize requests. Refer to the Tinybird documentation on authenticating requests to learn how to obtain an API key or access token.
If Tinybird is behind a firewall, you must also allow access from Retool's IP addresses. Add these IP addresses to your firewall's allowlist before you create the resource.
1. Create a new resource
Sign in to your Retool organization and navigate to the Resources tab. Click Create new, then select Resource.
Retool can connect to almost any API or database, and has built-in integrations for popular data sources. Select the REST API integration.
2. Configure the resource
Provide the necessary details to configure the resource so Retool can connect to Tinybird. Not all settings are required but refer to the Tinybird documentation to learn what is needed.
General
These settings configure the name and location of the resource within Retool.
Name
The name to use for the resource (e.g., Tinybird).
Folder
The folder in which to save the resource.
Description
A brief description of the resource (e.g., Tinybird data).
Credentials
These settings configure how Retool connects to Tinybird.
Base URL
The base URL for the Tinybird API. This must be an absolute URL. Use https://api.tinybird.co/v0/
.
URL parameters
Key-value pairs to include as URL parameters with Tinybird API requests. No additional URL parameters are required unless you're using the token
URL parameter for authentication. If so, you need to pass:
URL parameter | Value |
---|---|
token | access_token |
Headers
Key-value pairs to include as headers with Tinybird API requests. If you're using Bearer (token) authentication, include the following key-value pairs:
Key | Value |
---|---|
Authorization | Bearer access_token |
Body
Key-value pairs to include in the body of Tinybird API requests. No additional body values are required.
Cookies
Cookies to include with Tinybird API requests. No cookies are required.
Authentication
The method of authentication to use with Tinybird. Select None
. Tinybird authenticates requests using the API key or token you specified as a header value or as a URL parameter.
Forward all cookies
Whether to forward all cookies. This is useful if you have dynamic cookie names.
3. Save the resource
Click Create resource to complete the setup. You can then click either Create an app to immediately start building a Retool app or Back to resources to return to the list of resources.
Wrap up
Your Tinybird resource is now ready to use. You write queries to make API requests by specifying the request method and endpoint, additional parameters to include, and the request body.
To verify you can successfully interact with Tinybird, write a test query to retrieve some data. The following example retrieves a list of the data sources in your account.
- Request
- Response
GET https://api.tinybird.co/v0/datasources
{
"datasources": [
{
"id": "r_a0496ebbe5e5749433a",
"name": "your_datasource_name",
"cluster": "tinybird",
"tags": {},
"created_at": "2023-2-13 13:53:05.340975",
"updated_at": "2022-02-11 13:11:19.464343",
"replicated": true,
"version": 0,
"project": null,
"headers": {},
"shared_with": [
"a6e8-89496c219-7f1909c8fff"
],
"engine": {
"engine": "MergeTree",
"engine_sorting_key": "example_column_1",
"engine_partition_key": "",
"engine_primary_key": "example_column_1"
},
"description": "",
"used_by": [],
"type": "csv",
"columns": [
{
"name": "example_column_1",
"type": "Date",
"codec": null,
"default_value": null,
"jsonpath": null,
"nullable": false,
"normalized_name": "example_column_1"
},
{
"name": "example_column_2",
"type": "String",
"codec": null,
"default_value": null,
"jsonpath": null,
"nullable": false,
"normalized_name": "example_column_2"
}
],
"statistics": {
"bytes": 77822,
"row_count": 226188
},
"new_columns_detected": {},
"quarantine_rows": 0
}
]
}