Work in progress.
This project is incomplete, drastic API changes are likely, and support will be limited for early adopters. Please keep this in mind. Try airtable.java in the meantime.
An Airtable Java Driver based on okhttp and Gson, inspired by airtable.java
<repositories>
<repository>
<id>paradaux</id>
<url>https://repo.paradaux.io/snapshots</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.paradaux</groupId>
<artifactId>airtable4j</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
</dependencies>
plugins {
id "com.github.johnrengelman.shadow" version "6.1.4"
}
repositories {
maven {
url = "https://repo.paradaux.io/snapshots"
}
}
dependencies {
implementation "io.paradaux:airtable4j:0.1-SNAPSHOT"
}
This is subject to change.
This uses a fictional GSON-serializable POJO Post for the purposes of an example type parameter.
Airtable4J airtable4J = new Airtable4J(API_KEY);
ABase<Post> base = airtable4J.base(BASE_ID);
ATable<Post> table = base.table("Queue")
table.create(new Post("someField", "someOtherField"));
As the airtable API provides additional informaiton which each record response (i.e the record ID and creationTime of that record) your POJO is wrapped in a QueryRecord which contains that meta information. You can receive the record itself using QueryRecord<T>#getRecord
List<QueryRecord<Post>> posts = table.list()
.field("ID")
.maxRecords(5)
.pageSize(5)
.cellFormat(ACellFormat.JSON)
.timeZone("Europe/Dublin")
.execute(Post.class);
This next section is for functionality which is not yet present in the api
Not available
Post post = table.retrieve("rec6ZbJAFCM146e88");
Not available
table.delete("rec6ZbJAFCM146e88");
This replaces the provided record with the instance of T provided.
Not available
table.put("rec6ZbJAFCM146e88", new Post("someBetterField", "thisOneisEvenBetter"));
You only specify which fields you wish to change. If you want to replace a record using a POJO use the override functionality.
Not available
table.put("rec6ZbJAFCM146e88", Map<String, String> fields);