Help

Java 404 Error when connecting to Airtable

Topic Labels: API
1560 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Jack_Davies
4 - Data Explorer
4 - Data Explorer

Hi guys,
Completely new to Airtable and have been following the https://github.com/Sybit-Education/airtable.java guide to integrate Airtable with my java project. I understand this is a new API client and is probably not fully supported yet.
I think I have everything set up correctly but I seem to get the following error when making any requests to the database:
Exception in thread “main” com.sybit.airtable.exception.AirtableException: Could not find what you are looking for (NOT_FOUND) [Http code 404]

I’m certain that my API key, base name and table name are all correct. Here is the code used in my project to connect to Airtable:

import com.sybit.airtable.Airtable;
import com.sybit.airtable.Base;
import com.sybit.airtable.Table;
import com.sybit.airtable.exception.AirtableException;
import org.apache.http.client.HttpResponseException;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

public class DatabaseService {
    private static final String AIRTABLE_API_KEY =  <MY_API_KEY>;
    private Airtable AT;
    private Base base;

    public DatabaseService() throws AirtableException {
        AT = new Airtable().configure(AIRTABLE_API_KEY);
        base = AT.base("CrimeStatistics");

    }

    public void saveRecord(Record record) throws InvocationTargetException, AirtableException, 
NoSuchMethodException, IllegalAccessException {
        Table<Record> vocab = base.table("Vocab", Record.class);

        vocab.create(record);
    }

    public List<Record> getRecord() throws AirtableException, HttpResponseException {
        List<Record> record = base.table("Vocab", Record.class).select();
        return record;
    }
}

I’ve tried the saveRecord() and getRecord() methods. The saveRecord() method uses a custom class Record with a serialized names for each table column.

Due to it being a new API client there isn’t much information on this error available online, so any help would be much appreciated

0 Replies 0