Java client library for Rootly incident management platform, auto-generated from OpenAPI specifications.
Add this dependency to your project's POM:
<dependency>
<groupId>com.rootly.client</groupId>
<artifactId>rootly</artifactId>
<version>0.0.4</version>
</dependency>Add this dependency to your project's build file:
dependencies {
implementation 'com.rootly.client:rootly:0.0.4'
}To install the API client library to your local Maven repository:
./gradlew publishToMavenLocal
# or
mvn clean installimport com.rootly.client.ApiClient;
import com.rootly.client.Configuration;
import com.rootly.client.auth.HttpBearerAuth;
import com.rootly.client.api.IncidentsApi;
import com.rootly.client.model.IncidentList;
public class Example {
public static void main(String[] args) {
// Create and configure the API client
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.rootly.com");
// Configure authentication
HttpBearerAuth bearerAuth = (HttpBearerAuth) client.getAuthentication("bearer_auth");
bearerAuth.setBearerToken("YOUR_API_TOKEN");
// Use the client to make API calls
IncidentsApi incidentsApi = new IncidentsApi(client);
try {
IncidentList incidents = incidentsApi.listIncidents(null, null, null);
System.out.println(incidents);
} catch (Exception e) {
e.printStackTrace();
}
}
}- Navigate to Organization dropdown > Organization Settings > API Keys
- Generate a new API key
- Use the token in your client configuration
- Java 1.8 or later
- Maven 3.8.3+ or Gradle 7.2+
- OpenAPI Generator 7.13.0
The SDK is auto-generated from the Rootly OpenAPI specification:
# Fetch latest spec and regenerate code
make buildThis will:
- Fetch the OpenAPI spec from Rootly's S3 bucket
- Generate Java code using OpenAPI Generator
- Apply necessary patches
- Build:
./gradlew buildormvn clean package - Test:
./gradlew testormvn test - Format code:
./gradlew spotlessApplyormvn spotless:apply
Rootly uses the JSON:API specification:
- Content-Type:
application/vnd.api+json - Structured responses with
data,attributes, andrelationships - Standardized error handling
- 3000 requests per 60-second sliding window (per API key)
- Response headers include:
RateLimit-Limit: Maximum requests allowedRateLimit-Remaining: Remaining requests in current windowRateLimit-Reset: UTC epoch seconds when window resets
Contact your Rootly Customer Success Manager to adjust limits.
Use page[number] and page[size] query parameters:
// Example: Fetch page 2 with 25 items per page
IncidentList incidents = incidentsApi.listIncidents(
25, // page[size]
2, // page[number]
null // additional filters
);- API Classes (
com.rootly.client.api.*): Client implementations for all API endpoints - Model Classes (
com.rootly.client.model.*): Data transfer objects for requests/responses - Core Client (
com.rootly.client.ApiClient): HTTP client with authentication support - Authentication (
com.rootly.client.auth.*): Bearer token, API key, and basic auth implementations
This library is auto-generated from OpenAPI specifications. For API changes or issues:
- Report bugs or request features in this repository
- API specification changes should be directed to Rootly
Automatically generated by OpenAPI Generator