Sonoran.java is a library that allows you to interact with the Sonoran CAD API.
This library is a work in progress — many endpoints are not yet implemented.
I plan to support all major Sonoran CAD API endpoints in future updates.
- Clone the repository
git clone https://github.com/adamBurdik/Sonoran.java- Navigate to the directory
cd Sonoran.java- Build the module
gradlew build- Add Sonoran.java as a dependency to your project, using jitpack
maven { url = uri("https://www.jitpack.io") }
dependencies {
implementation("com.github.adamBurdik:Sonoran.java:VERSION") // Get version from https://github.com/AdamBurdik/Sonoran.java/releases
}- Create Sonoran instance with cad.
Sonoran sonoran = Sonoran.builder()
.withCad("CAD_API_TOKEN_HERE", "CAD_COMMUNITY_ID_HERE")
.build();
// Shuts down the internal HTTP client and task executor.
// Call this method during application shutdown to clean up resources.
sonoran.shutdown();- Use provided methods
// Prints the current Sonoran CAD version
sonoran.cad().getVersion()
.onSuccess(version -> System.out.println("Version: " + version))
.onError(error -> System.out.println("API error: " + error.message())) // Use onError to handle unsuccessful API responses
.onException(Throwable::printStackTrace); // Use onException to handle unexpected internal errors
// Retrieves the CAD Account for the provided username
sonoran.cad().getAccount("ACCOUNT_NAME_HERE")
.onSuccess(account -> System.out.println("Found account: " + account))
.onError(error -> System.out.println("API error: " + error.message()))
.onException(Throwable::printStackTrace);Contributions are welcome!
If you have suggestions, ideas, or issues, feel free to open an issue or contact me on discord: @adamix.dev.
Sonoran CAD Docs - Documentation for Sonoran CAD API
sonoran.js - Initial idea to create a library for java
minestom - Codec design