One-way sync help

I’m trying to get a one-way sync working. I’ve tried the code in both Getting Started Guide: Coda API and Al’s bog post. I’ve double checked my API key and doc IDs, but I keep getting a 404 error:

Request failed for returned code 404. Truncated server response: {“statusCode”:404,“statusMessage”:“Not Found”,“message”:“Could not find a table with the specified ID or name.”} (use muteHttpExceptions option to examine full response) (line 240, file “Coda”, project “Coda API”)

I tried to drill down and make sure I’m using the right doc IDs, so I ran the following function:

function printDocs() {
  var docs = CodaAPI.listDocs().items;
Logger.log('Third doc is ' + docs[2].id);

That function gave me the ID of the doc I want to use as my source doc. Let’s call it ab1cdeFg2h. I tried to print the tables of the Source Doc with the following:

function printDocTables() {
  var tables = CodaAPI.listTables(ab1cdeFg2h);
  Logger.log('Doc tables are: %s', prettyPrint(tables));

I got another error: ReferenceError: “ab1cdeFg2h” is not defined. (line 4, file “Get Tables”)

Anyone know what I’m doing wrong? Thanks!

Never mind—got it working. Al’s blog post helped: