Developers will need to create an API Key within your Developer Portal to make API requests. You can use your existing Airbyte account to log in to the Developer Portal. Once you are in the Developer Portal, use the API Keys tab to create or remove API Keys. You can see a walkthrough demo here🎦
The Developer Portal UI can also be used to help build your integration by showing information about network requests in the Requests tab. API usage information is also available to you in the Usage tab.
JDK 11 or later is required.
The samples below show how a published SDK artifact is used:
Gradle:
implementation 'com.airbyte:api:1.5.10'
Maven:
<dependency>
<groupId>com.airbyte</groupId>
<artifactId>api</artifactId>
<version>1.5.10</version>
</dependency>
After cloning the git repository to your file system you can build the SDK artifact from source to the build
directory by running ./gradlew build
on *nix systems or gradlew.bat
on Windows systems.
If you wish to build from source and publish the SDK artifact to your local Maven repository (on your filesystem) then use the following command (after cloning the git repo locally):
On *nix:
./gradlew publishToMavenLocal -Pskip.signing
On Windows:
gradlew.bat publishToMavenLocal -Pskip.signing
package hello.world;
import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Airbyte sdk = Airbyte.builder()
.security(Security.builder()
.basicAuth(SchemeBasicAuth.builder()
.password("")
.username("")
.build())
.build())
.build();
ConnectionCreateRequest req = ConnectionCreateRequest.builder()
.destinationId("c669dd1e-3620-483e-afc8-55914e0a570f")
.sourceId("6dd427d8-3a55-4584-b835-842325b6c7b3")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();
CreateConnectionResponse res = sdk.connections().createConnection()
.request(req)
.call();
if (res.connectionResponse().isPresent()) {
// handle response
}
} catch (com.airbyte.api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
- createConnection - Create a connection
- deleteConnection - Delete a Connection
- getConnection - Get Connection details
- listConnections - List connections
- patchConnection - Update Connection details
- createDestination - Create a destination
- deleteDestination - Delete a Destination
- getDestination - Get Destination details
- listDestinations - List destinations
- patchDestination - Update a Destination
- putDestination - Update a Destination and fully overwrite it
- getHealthCheck - Health Check
- cancelJob - Cancel a running Job
- createJob - Trigger a sync or reset job of a connection
- getJob - Get Job status and details
- listJobs - List Jobs by sync type
- listOrganizationsForUser - List all organizations for a user
- createPermission - Create a permission
- deletePermission - Delete a Permission
- getPermission - Get Permission details
- listPermissions - List Permissions by user id
- updatePermission - Update a permission
- createSource - Create a source
- deleteSource - Delete a Source
- getSource - Get Source details
- initiateOAuth - Initiate OAuth for a source
- listSources - List sources
- patchSource - Update a Source
- putSource - Update a Source and fully overwrite it
- getStreamProperties - Get stream properties
- listUsersWithinAnOrganization - List all users within an organization
- createOrUpdateWorkspaceOAuthCredentials - Create OAuth override credentials for a workspace and source type.
- createWorkspace - Create a workspace
- deleteWorkspace - Delete a Workspace
- getWorkspace - Get Workspace details
- listWorkspaces - List workspaces
- updateWorkspace - Update a workspace
You can override the default server globally by passing a server index to the serverIndex
builder method when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
# | Server | Variables |
---|---|---|
0 | https://api.airbyte.com/v1 |
None |
package hello.world;
import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Airbyte sdk = Airbyte.builder()
.serverIndex(0)
.security(Security.builder()
.basicAuth(SchemeBasicAuth.builder()
.password("")
.username("")
.build())
.build())
.build();
ConnectionCreateRequest req = ConnectionCreateRequest.builder()
.destinationId("c669dd1e-3620-483e-afc8-55914e0a570f")
.sourceId("6dd427d8-3a55-4584-b835-842325b6c7b3")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();
CreateConnectionResponse res = sdk.connections().createConnection()
.request(req)
.call();
if (res.connectionResponse().isPresent()) {
// handle response
}
} catch (com.airbyte.api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
The default server can also be overridden globally by passing a URL to the serverURL
builder method when initializing the SDK client instance. For example:
package hello.world;
import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Airbyte sdk = Airbyte.builder()
.serverURL("https://api.airbyte.com/v1")
.security(Security.builder()
.basicAuth(SchemeBasicAuth.builder()
.password("")
.username("")
.build())
.build())
.build();
ConnectionCreateRequest req = ConnectionCreateRequest.builder()
.destinationId("c669dd1e-3620-483e-afc8-55914e0a570f")
.sourceId("6dd427d8-3a55-4584-b835-842325b6c7b3")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();
CreateConnectionResponse res = sdk.connections().createConnection()
.request(req)
.call();
if (res.connectionResponse().isPresent()) {
// handle response
}
} catch (com.airbyte.api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Exception type.
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | */* |
package hello.world;
import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Airbyte sdk = Airbyte.builder()
.security(Security.builder()
.basicAuth(SchemeBasicAuth.builder()
.password("")
.username("")
.build())
.build())
.build();
ConnectionCreateRequest req = ConnectionCreateRequest.builder()
.destinationId("c669dd1e-3620-483e-afc8-55914e0a570f")
.sourceId("6dd427d8-3a55-4584-b835-842325b6c7b3")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();
CreateConnectionResponse res = sdk.connections().createConnection()
.request(req)
.call();
if (res.connectionResponse().isPresent()) {
// handle response
}
} catch (com.airbyte.api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
This SDK supports the following security schemes globally:
Name | Type | Scheme |
---|---|---|
basicAuth |
http | HTTP Basic |
bearerAuth |
http | HTTP Bearer |
clientCredentials |
oauth2 | OAuth2 token |
You can set the security parameters through the security
builder method when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
package hello.world;
import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Airbyte sdk = Airbyte.builder()
.security(Security.builder()
.basicAuth(SchemeBasicAuth.builder()
.password("")
.username("")
.build())
.build())
.build();
ConnectionCreateRequest req = ConnectionCreateRequest.builder()
.destinationId("c669dd1e-3620-483e-afc8-55914e0a570f")
.sourceId("6dd427d8-3a55-4584-b835-842325b6c7b3")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();
CreateConnectionResponse res = sdk.connections().createConnection()
.request(req)
.call();
if (res.connectionResponse().isPresent()) {
// handle response
}
} catch (com.airbyte.api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !