Discuss Template: Getting Started Guide - Coda API

Have any questions on Getting Started Guide - Coda API? Ask away here.

3 Likes

Linking to an existing thread on this topic: One-way sync (handle pagination for syncing source tables with >500 items)

hi @oleg I am going through the guide, but I am not understanding. In the guide, it suggests to use the createDoc() function to create your first doc. The way the getting started guide is set up, it suggests you can figure it out on your own, since it has a Show Solution feature to hide the code solution.

So I went to the CodaAPI to see how I could figure out how to create the doc. There’s nothing listed showing that method/formula/endpoint. In fact, if you search the whole page nothing shows for CreateDoc except one place where it talks about free vs paid workspaces.

I was expecting something akin to https://coda.io/formulas - am I missing something here?

2 Likes

Hi @Johg_Ananda, sorry for the late reply. Apologies if it was unclear, but the “#createDoc” text in the API docs is actually a link that goes to https://coda.io/developers/apis/v1beta1#operation/createDoc. Technically the “operation ID” of that endpoint is createDoc, but I guess the actual docs don’t really expose that anywhere (other than in the link itself). You should also be able to find it if you explore the navigation / table of contents on the left side: under “Docs”, it’s the “Create a doc” endpoint. Hope that helps!

1 Like

hey thanks for the reply @oleg! I’m new to the API docs, so I’m looking at these with beginner’s eyes. Help me understand - why aren’t they set up the same way as the formulas? Why doesn’t the string ‘createdoc’ appear on the page?

I feel like if that is a method/formula the text ‘createdoc’ should appear on the page?

The formulas you’re referring to are JavaScript functions, part of the Google Apps Script library for the Coda API. The Google Apps Script library is provided as a convenience to having to write your own code to handle the actual network requests. The API documentation is general documentation for the REST API.

Aside from the Google Apps Script library, there are other third-party client libraries that wrap these REST endpoints. Each library and language has its own conventions for how API methods are exposed and named, so you might have to look through the docs yourself to find the associated endpoint rather than relying on Ctrl/Cmd+F search.

To follow up, I should note that we actually have example code for Google Apps Script in the documentation:

image

But, note that the default sample points to Python code, so you won’t be able to find it unless you select “Google Apps Script” for the endpoint you’re interested in.

In the tutorial the printImageUrlTest() which is supposed to get the ‘latest pic of Paris’ is failing:

1 Like

Just updated the documentation, but looks like you need to add the date parameter to the API call since there doesn’t appear to be any recent images. Change the nasaURL to this: https://api.nasa.gov/planetary/earth/assets/?api_key=DEMO_KEY&dim=0.1&date=2017-01-01