Airtable Java library: Cookie header issue and record selection problem

Hey folks, I’m stuck with an Airtable issue using their Java library. I’m trying to grab records from a specific view, but I’m hitting a wall.

I’ve set up everything like this:

Airtable myAirtable = new Airtable().configure(MY_API_KEY);
Base myBase = myAirtable.base("my-base-id");

But when I try to select records, I get this weird error:

WARNING: Invalid cookie header: "Set-Cookie: session=abc123; path=/; expires=Sat, 13 Nov 2021 10:00:00 GMT; domain=.airtable.com; samesite=none; secure; httponly". Invalid 'expires' attribute: Sat, 13 Nov 2021 10:00:00 GMT
Exception: {"error":"NOT_FOUND"} (UNDEFINED_ERROR) [Http code 404]

Here’s the method causing trouble:

public void getViewData() throws AirtableException {
    List<Station> locations = myBase.table("Transport").select("Locations");
}

I expected this to fill my list with all locations from the Transport table. Am I missing something obvious? Any tips would be awesome!

hey mate, i’ve dealt with similar headaches using airtable’s java lib. for the cookie thing, slap in slf4j and log4j deps in ur build.gradle. that’ll shut it up.

for the not_found error, double-check ur using the base ID (starts with ‘app’) not the name. also, make sure ur view name’s exact. try this:

myBase.table(“Transport”).select(new SelectQueryOptions().view(“Locations”))

good luck!

I’ve run into similar issues with the Airtable Java library before. The cookie header warning is annoying but usually harmless - adding SLF4J and configuring logging as suggested should resolve it.

For the NOT_FOUND error, verify you’re using the base ID rather than the base name. Using the wrong identifier is a common oversight; the base ID should look like ‘appXXXXXXXXXXXXXX’.

Also, ensure that the view name in your select call exactly matches what exists in your base. If ‘Locations’ isn’t an exact match, the query will return a 404 error. For instance, you could try:

List locations = myBase.table(“Transport”).select(new SelectQueryOptions().view(“Locations”));

This explicitly sets the view option and might clear up the error. Hope this helps.

I’ve encountered similar issues with the Airtable Java library. For the cookie header warning, add SLF4J and Log4j dependencies to your build.gradle file. This should resolve the warning without impacting functionality.

Regarding the NOT_FOUND error, ensure you’re using the correct base ID (starting with ‘app’) instead of the base name. Also, verify that the view name in your select call matches exactly what’s in your Airtable base.

Try modifying your code like this:

Base myBase = myAirtable.base("appXXXXXXXXXXXXXX"); // Use your actual base ID
List<Station> locations = myBase.table("Transport").select(new SelectQueryOptions().view("Locations"));

This approach explicitly sets the view option and should resolve the 404 error. Double-check your API key and permissions as well. If issues persist, consider reviewing Airtable’s API documentation for any recent changes or known issues.