GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - airbytehq/airbyte-api-java-sdk: Java SDK for Airbyte API

BranchesTags
Open more actions menu

Latest commit

 

History

400 Commits
400 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.speakeasy
.speakeasy
 
 
docs
docs
 
 
gradle/wrapper
gradle/wrapper
 
 
src/main/java/com/airbyte/api
src/main/java/com/airbyte/api
 
 
.genignore
.genignore
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
RELEASES.md
RELEASES.md
 
 
USAGE.md
USAGE.md
 
 
build-extras.gradle
build-extras.gradle
 
 
build.gradle
build.gradle
 
 
files.gen
files.gen
 
 
gen.yaml
gen.yaml
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

public-api

Developer-friendly & type-safe Java SDK specifically catered to leverage public-api API.

Summary

airbyte-api: Programmatically control Airbyte Cloud, OSS & Enterprise.

Table of Contents

  • public-api
    • SDK Installation
    • SDK Example Usage
    • Authentication
    • Available Resources and Operations
    • Error Handling
    • Server Selection
  • Development
    • Maturity
    • Contributions

SDK Installation

Getting started

JDK 11 or later is required.

The samples below show how a published SDK artifact is used:

Gradle:

implementation 'com.airbyte:api:2.0.0'

Maven:

<dependency>
    <groupId>com.airbyte</groupId>
    <artifactId>api</artifactId>
    <version>2.0.0</version>
</dependency>

How to build

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

Logging

A logging framework/facade has not yet been adopted but is under consideration.

For request and response logging (especially json bodies) use:

SpeakeasyHTTPClient.setDebugLogging(true); // experimental API only (may change without warning)

Example output:

Sending request: http://localhost:35123/bearer#global GET
Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]}
Received response: (GET http://localhost:35123/bearer#global) 200
Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]}
Response body:
{
  "authenticated": true, 
  "token": "global"
}

WARNING: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via SpeakeasyHTTPClient.setRedactedHeaders.

Another option is to set the System property -Djdk.httpclient.HttpClient.log=all. However, this second option does not log bodies.

SDK Example Usage

Example

package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.CreateConnectionResponse;
import com.airbyte.api.models.shared.*;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
            .build();

        ConnectionCreateRequest req = ConnectionCreateRequest.builder()
                .destinationId("e478de0d-a3a0-475c-b019-25f7dd29e281")
                .sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
                .name("Postgres-to-Bigquery")
                .build();

        CreateConnectionResponse res = sdk.connections().createConnection()
                .request(req)
                .call();

        if (res.connectionResponse().isPresent()) {
            // handle response
        }
    }
}

Authentication

Per-Client Security Schemes

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.CreateConnectionResponse;
import com.airbyte.api.models.shared.*;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
            .build();

        ConnectionCreateRequest req = ConnectionCreateRequest.builder()
                .destinationId("e478de0d-a3a0-475c-b019-25f7dd29e281")
                .sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
                .name("Postgres-to-Bigquery")
                .build();

        CreateConnectionResponse res = sdk.connections().createConnection()
                .request(req)
                .call();

        if (res.connectionResponse().isPresent()) {
            // handle response
        }
    }
}

Available Resources and Operations

Available methods

connections()

  • createConnection - Create a connection
  • deleteConnection - Delete a Connection
  • getConnection - Get Connection details
  • listConnections - List connections
  • patchConnection - Update Connection details

declarativeSourceDefinitions()

  • createDeclarativeSourceDefinition - Create a declarative source definition.
  • deleteDeclarativeSourceDefinition - Delete a declarative source definition.
  • getDeclarativeSourceDefinition - Get declarative source definition details.
  • listDeclarativeSourceDefinitions - List declarative source definitions.
  • updateDeclarativeSourceDefinition - Update declarative source definition details.

destinationDefinitions()

  • createDestinationDefinition - Create a destination definition.
  • deleteDestinationDefinition - Delete a destination definition.
  • getDestinationDefinition - Get destination definition details.
  • listDestinationDefinitions - List destination definitions.
  • updateDestinationDefinition - Update destination definition details.

destinations()

  • 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

health()

  • getHealthCheck - Health Check

jobs()

  • 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

organizations()

  • listOrganizationsForUser - List all organizations for a user

permissions()

  • createPermission - Create a permission
  • deletePermission - Delete a Permission
  • getPermission - Get Permission details
  • listPermissions - List Permissions by user id
  • updatePermission - Update a permission

sourceDefinitions()

  • createSourceDefinition - Create a source definition.
  • deleteSourceDefinition - Delete a source definition.
  • getSourceDefinition - Get source definition details.
  • listSourceDefinitions - List source definitions.
  • updateSourceDefinition - Update source definition details.

sources()

  • 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

streams()

  • getStreamProperties - Get stream properties

tags()

  • createTag - Create a tag
  • deleteTag - Delete a tag
  • getTag - Get a tag
  • listTags - List all tags
  • updateTag - Update a tag

users()

  • listUsersWithinAnOrganization - List all users within an organization

workspaces()

  • 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

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.

By default, an API error will throw a models/errors/SDKError exception. When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the createConnection method throws the following exceptions:

Error Type Status Code Content Type
models/errors/SDKError 4XX, 5XX */*

Example

package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.CreateConnectionResponse;
import com.airbyte.api.models.shared.*;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
            .build();

        ConnectionCreateRequest req = ConnectionCreateRequest.builder()
                .destinationId("e478de0d-a3a0-475c-b019-25f7dd29e281")
                .sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
                .name("Postgres-to-Bigquery")
                .build();

        CreateConnectionResponse res = sdk.connections().createConnection()
                .request(req)
                .call();

        if (res.connectionResponse().isPresent()) {
            // handle response
        }
    }
}

Server Selection

Override Server URL Per-Client

The default server can be overridden globally using the .serverURL(String 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.CreateConnectionResponse;
import com.airbyte.api.models.shared.*;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        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("e478de0d-a3a0-475c-b019-25f7dd29e281")
                .sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
                .name("Postgres-to-Bigquery")
                .build();

        CreateConnectionResponse res = sdk.connections().createConnection()
                .request(req)
                .call();

        if (res.connectionResponse().isPresent()) {
            // handle response
        }
    }
}

Development

Maturity

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.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.

SDK Created by Speakeasy

About

Java SDK for Airbyte API

api.airbyte.com/

Topics

airbyteapijavasdk

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

24 stars

Watchers

4 watching

Forks

11 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.