1

I'm trying to select a record from particular view in Airtable using the Java library

So far i have set break points to check if everything is initialised and it seems be okay. My api key is correct and the Airtable instance is setup correctly.

 Airtable airtable = new Airtable().configure(AIRTABLE_API_KEY);
 Base basebase = airtable.base("my-airtable-base");

This is my error:

Nov 12, 2020 5:53:08 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: brw=brwkel6HWNoWVEl49; path=/; expires=Fri, 12 Nov 2021 17:53:08 GMT; domain=.airtable.com; samesite=none; secure; httponly". Invalid 'expires' attribute: Fri, 12 Nov 2021 17:53:08 GMT
Exception in thread "main" com.sybit.airtable.exception.AirtableException: {"error":"NOT_FOUND"} (UNDEFINED_ERROR) [Http code 404]
    at com.sybit.airtable.exception.HttpResponseExceptionHandler.onResponse(HttpResponseExceptionHandler.java:29)
    at com.sybit.airtable.Table.select(Table.java:206)
    at com.sybit.airtable.Table.select(Table.java:327)
    at com.hived.AirtableInstance.selectTableView(AirtableInstance.java:43)
    at com.hived.Main.main(Main.java:25)

This is the function that is causing the error:

  public void selectTableView() throws AirtableException, HttpResponseException {
        List<Bus> stops = base.table("Bus").select("Stops");
    }

I was expecting it to pass all stops from the bus table into the stops list.

I'm not sure what I'm doing wrong, so any help would be much appreciated.

magicmass
  • 89
  • 9
  • 1
    What do you mean by "This is the function that is causing the error"? I don't see it in the stack trace. - It looks like `selectARecord` is your culprit. – CryptoFool Nov 12 '20 at 17:49
  • Sorry @Steve, entered in the wrong stack trace. Updated it now. – magicmass Nov 12 '20 at 17:54

1 Answers1

0

Turns out you need to do a few things.

  1. Add log4j to your project
  2. Add slf4j-simple to your project

Once those dependencies are added. You should now see there is no warning anymore.

Now to remove the error. It turns out instead of referencing the base name, you need to call the base id instead.

base = airtable.base("applJilugnJCtDRdh");

Thats it! Hope this helps anyone else.

magicmass
  • 89
  • 9