Skip to content

New Integration Request: Coda.io tables #2167

Closed
@jim-barlow

Description

@jim-barlow

Tell us about the new integration you’d like to have

Coda is a pretty awesome tool which we have used for a number of things, but has always been limited for our use-cases as we couldn't get data out (and into BigQuery, in our case) in a non-hacky way.

Describe the context around this new integration

IMHO the only data you actually want out of Coda is anything stored in tables, and they provide a pretty clean API and awesome documentation here. We use it for multiple things but the structured data is in the tables.

Describe the alternative you are considering or using

I spent an hour testing it this morning and I will probably spin something up pretty quickly as a Cloud Function which would stream JSON into BQ upon invocation (probably on a schedule, or maybe via HTTP request from a button in Coda) - I'd then deal with JSON decoding and deduplication downstream in BigQuery. However since it seems like such a simple API to interact with (i.e. no real need for a client library in this instance, and only ), I'd be keen on using this as a learning case for one of my guys to build an Airbyte connector.

Let me know what you think, my python code is below (no pagination as the test tables are small). You get the API key coda_token from your admin dashboard, simples.

import requests

# get this from coda account settings at https://coda.io/account
coda_token = "YOUR_API_KEY"

# get owned docs
headers = {'Authorization': f'Bearer {coda_token}'}
docs_uri = 'https://coda.io/apis/v1/docs'
docs_params = {'isOwner': True}
docs_response = requests.get(docs_uri, headers=headers, params=docs_params).json()

# get doc_ids
for doc in docs_response['items']:
    doc_id = doc['id']
    tables_uri = f'https://coda.io/apis/v1/docs/{doc_id}/tables'
    tables_response = requests.get(tables_uri, headers=headers).json()
    
    # get table_ids in docs and get rows 
    for table in tables_response['items']:
        table_id = table['id']

        rows_params = {'useColumnNames': 'true' , 'valueFormat': 'simpleWithArrays'} 
        rows_uri = f'https://coda.io/apis/v1/docs/{doc_id}/tables/{table_id}/rows'
        rows_response = requests.get(rows_uri, headers=headers, params=rows_params).json()

        print(rows_response)




┆Issue is synchronized with this Asana task by Unito

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions