Accounting: The documentation for the StackOne Unified API - ACCOUNTING
JDK 11 or later is required.
The samples below show how a published SDK artifact is used:
Gradle:
implementation 'com.stackone:stackone-client-java:0.12.1'
Maven:
<dependency>
<groupId>com.stackone</groupId>
<artifactId>stackone-client-java</artifactId>
<version>0.12.1</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.stackone.stackone_client_java.StackOne;
import com.stackone.stackone_client_java.models.components.Security;
import com.stackone.stackone_client_java.models.errors.*;
import com.stackone.stackone_client_java.models.operations.*;
import java.lang.Exception;
import java.time.OffsetDateTime;
public class Application {
public static void main(String[] args) throws Exception {
StackOne sdk = StackOne.builder()
.security(Security.builder()
.username("")
.password("")
.build())
.build();
HrisListEmployeesRequest req = HrisListEmployeesRequest.builder()
.xAccountId("<id>")
.fields("id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,created_at,updated_at,benefits,employee_number,national_identity_number,national_identity_numbers,skills")
.filter(HrisListEmployeesQueryParamFilter.builder()
.updatedAfter(OffsetDateTime.parse("2020-01-01T00:00:00.000Z"))
.build())
.expand("company,employments,work_location,home_location,groups,skills")
.include("avatar_url,avatar,custom_fields,job_description,benefits")
.build();
sdk.hris().listEmployees()
.request(req)
.callAsStream()
.forEach((HrisListEmployeesResponse item) -> {
// handle page
});
}
}
Available methods
- listCompanies - List Companies
- getCompany - Get Company
- listCompanyAccounts - List Accounts
- getCompanyAccount - Get Account
- listCompanyTaxRates - List Tax Rates
- getCompanyTaxRate - Get Tax Rate
- batchCreateCompanyJournals - Batch Create Journals
- listCompanyJournals - List Journals
- createCompanyJournal - Create Journal
- getCompanyJournal - Get Journal
- listLinkedAccounts - List Accounts
- getAccount - Get Account
- deleteAccount - Delete Account
- updateAccount - Update Account
- getAccountMetaInfo - Get Account Meta Information
- listApplications - List Applications
- createApplication - Create Application
- getApplication - Get Application
- updateApplication - Update Application
- listApplicationsOffers - List Application Offers
- moveApplication - Move Application
- rejectApplication - Reject Application
- getApplicationOffer - Get Application Offer
- listApplicationScorecards - List Application Scorecards
- getApplicationScorecard - Get Application Scorecard
- listApplicationChanges - List Application Changes
- listApplicationNotes - List Application Notes
- createApplicationNote - Create Application Note
- getApplicationNote - Get Application Note
- updateApplicationNote - Update Application Note
- listApplicationsScheduledInterviews - List Applications scheduled interviews
- getApplicationScheduledInterview - Get Applications scheduled interview
- uploadApplicationDocument - Upload Application Document
- downloadApplicationDocument - Download Application Document
- listApplicationDocuments - List Application Documents
- getApplicationDocument - Get Application Document
- listCandidates - List Candidates
- createCandidate - Create Candidate
- getCandidate - Get Candidate
- updateCandidate - Update Candidate
- listCandidateNotes - List Candidate Notes
- createCandidateNote - Create Candidate Note
- getCandidateNote - Get Candidate Note
- listApplicationCustomFieldDefinitions - List Application Custom Field Definitions
- getApplicationCustomFieldDefinition - Get Application Custom Field Definition
- listCandidateCustomFieldDefinitions - List Candidate Custom Field Definitions
- getCandidateCustomFieldDefinition - Get Candidate Custom Field Definition
- listJobCustomFieldDefinitions - List Job Custom Field Definitions
- getJobCustomFieldDefinition - Get Job Custom Field Definition
- listDepartments - List Departments
- getDepartment - Get Department
- listInterviewStages - List Interview Stages
- getInterviewStage - Get Interview Stage
- listInterviews - List Interviews
- getInterview - Get Interview
- listJobs - List Jobs
- createJob - Create Job
- listJobApplicationStages - List Job Application Stages
- getJob - Get Job
- updateJob - Update Job
- getJobApplicationStage - Get Job Application Stage
- listLists - Get all Lists
- getList - Get List
- listLocations - List locations
- getLocation - Get Location
- listRejectedReasons - List Rejected Reasons
- getRejectedReason - Get Rejected Reason
- listUsers - List Users
- getUser - Get User
- listJobPostings - List Job Postings
- getJobPosting - Get Job Posting
- listOffers - List Offers
- createOffer - Create Offer
- getOffer - Get Offer
- listAssessmentsPackages - List Assessments Packages
- getAssessmentsPackage - Get Assessments Package
- orderAssessmentsRequest - Order Assessments Request
- updateAssessmentsResult - Update Assessments Result
- listBackgroundCheckPackages - List Background Check Packages
- createBackgroundCheckPackage - Create Background Check Package
- getBackgroundCheckPackage - Get Background Check Package
- deleteBackgroundCheckPackage - Delete Background Check Package
- updateBackgroundCheckPackage - Update Background Check Package
- orderBackgroundCheckRequest - Order Background Check Request
- updateBackgroundCheckResult - Update Background Check Result
- listApplicationDocumentCategories - List Application Document Categories
- getApplicationDocumentCategory - Get Application Document Category
- listConnectorsMeta - List Connector Meta Information
- getConnectorMeta - Get Connector Meta Information
- createConnectSession - Create Connect Session
- authenticateConnectSession - Authenticate Connect Session
- listContacts - List Contacts
- createContact - Create Contact
- getContact - Get Contact
- updateContact - Update Contact (early access)
- listAccounts - List Accounts
- getAccount - Get Account
- listLists - Get all Lists
- getList - Get List
- listContactCustomFieldDefinitions - List Contact Custom Field Definitions
- getContactCustomFieldDefinition - Get Contact Custom Field Definition
- downloadFile - Download File
- uploadFile - Upload File
- listFiles - List Files
- getFile - Get File
- listFolders - List Folders
- getFolder - Get Folder
- listDrives - List Drives
- getDrive - Get Drive
- listCompanies - List Companies
- getCompany - Get Company
- listEmployeeCustomFieldDefinitions - List employee Custom Field Definitions
- getEmployeeCustomFieldDefinition - Get employee Custom Field Definition
- listEmployees - List Employees
- createEmployee - Create Employee
- getEmployee - Get Employee
- updateEmployee - Update Employee
- inviteEmployee - Invite Employee
- listEmployeeTimeOffRequests - List Employee Time Off Requests
- createEmployeeTimeOffRequest - Create Employee Time Off Request
- getEmployeesTimeOffRequest - Get Employees Time Off Request
- cancelEmployeeTimeOffRequest - Cancel Employee Time Off Request
- updateEmployeeTimeOffRequest - Update Employee Time Off Request
- batchUploadEmployeeDocument - Batch Upload Employee Document
- uploadEmployeeDocument - Upload Employee Document
- downloadEmployeeDocument - Download Employee Document
- listEmployeeDocuments - List Employee Documents
- getEmployeeDocument - Get Employee Document
- listEmployeeCategories - List Employee Document Categories
- getEmployeeDocumentCategory - Get Employee Document Category
- listEmployeeWorkEligibility - List Employee Work Eligibility
- createEmployeeWorkEligibilityRequest - Create Employee Work Eligibility Request
- getEmployeesWorkEligibility - Get Employees Work Eligibility
- updateEmployeeWorkEligibilityRequest - Update Employee Work Eligibility Request
- listEmployeeTimeOffBalances - List Employee Time Off Balances
- getEmployeeTimeOffBalance - Get Employee Time Off Balance
- listEmployments - List Employments
- getEmployment - Get Employment
- listEmployeeEmployments - List Employee Employments
- createEmployeeEmployment - Create Employee Employment
- getEmployeeEmployment - Get Employee Employment
- updateEmployeeEmployment - Update Employee Employment
- listGroups - List Groups
- listDepartmentGroups - List Department Groups
- listCostCenterGroups - List Cost Center Groups
- listTeamGroups - List Team Groups
- listDivisionGroups - List Division Groups
- listCompaniesGroups - List Companies Groups
- getGroup - Get Group
- getDepartmentGroup - Get Department Group
- getCostCenterGroup - Get Cost Center Group
- getTeamGroup - Get Team Group
- getDivisionGroup - Get Division Group
- getCompanyGroup - Get Company Group
- listJobs - List Jobs
- getJob - Get Job
- listLocations - List Work Locations
- getLocation - Get Work Location
- listPositions - List Positions
- getPosition - Get Position
- listTimeEntries - List Time Entries
- getTimeEntries - Get Time Entry
- listTimeOffRequests - List time off requests
- getTimeOffRequest - Get time off request
- listShifts - List Shifts
- getShift - Get Shift
listTimeOffTypes- List time off types⚠️ DeprecatedgetTimeOffType- Get time off type⚠️ Deprecated- listTimeOffPolicies - List Time Off Policies
- getTimeOffPolicy - Get Time Off Policy
- listEmployeeTimeOffPolicies - List Assigned Time Off Policies
- listBenefits - List benefits
- getBenefit - Get Benefit
- listEmployeeSkills - List Employee Skills
- createEmployeeSkill - Create Employee Skill
- getEmployeeSkill - Get Employee Skill
- listEmployeeTasks - List Employee Tasks
- getEmployeeTask - Get Employee Task
- updateEmployeeTask - Update Employee Task
- listTasks - List Tasks
- getTask - Get Task
- listUsers - List Users
- getUser - Get User
- deleteUser - Delete User
- updateUser - Update User
- listRoles - List Roles
- getRole - Get Role
- listGroups - List Groups
- getGroup - Get Group
- listPolicies - List Policies
- getPolicy - Get Policy
- listCourses - List Courses
- getCourse - Get Course
- listUserAssignments - List User Assignments
- createUserAssignment - Create User Assignment
- getUserAssignment - Get User Assignment
- batchUpsertContent - Batch Upsert Content
- listContent - List Content
- upsertContent - Upsert Content
- getContent - Get Content
- updateContent - Update Content
- listUserCompletions - List User Completions
- createUserCompletion - Create User Completion
- getUserCompletion - Get User Completion
- deleteUserCompletion - Delete User Completion
- listCompletions - List Completions
- getCompletion - Get Completion
- getCategory - Get Category
- listCategories - List Categories
- listUsers - List Users
- getUser - Get User
- getSkill - Get Skill
- listSkills - List Skills
- listAssignments - List Assignments
- getAssignment - Get Assignment
- listEmailTemplates - List Email Templates
- createEmailTemplate - Create Email Templates
- getEmailTemplate - Get Email Templates
- updateEmailTemplate - Update Email Templates
- listInAppTemplates - List In-App Templates
- createInAppTemplate - Create In-App Template
- getInAppTemplate - Get In-App Template
- updateInAppTemplate - Update In-App Template
- listSmsTemplates - List SMS Templates
- createSmsTemplate - Create SMS Template
- getSmsTemplate - Get SMS Template
- updateSmsTemplate - Update SMS Template
listOmniChannelTemplates- List Omni-Channel Templates⚠️ DeprecatedcreateOmniChannelTemplate- Create Omni-Channel Template⚠️ DeprecatedgetOmniChannelTemplate- Get Omni-Channel Template⚠️ DeprecatedupdateOmniChannelTemplate- Update Omni-Channel Template⚠️ Deprecated- listPushTemplates - List Push Templates
- createPushTemplate - Create Push Template
- getPushTemplate - Get Push Template
- updatePushTemplate - Update Push Template
- listCampaigns - List campaigns
- getCampaign - Get campaign
- listContentBlocks - List Content Blocks
- createContentBlock - Create Content Block
- getContentBlock - Get Content Blocks
- updateContentBlock - Update Content Block
- listConversations - List Conversations
- createConversation - Create Conversation
- getConversation - Get Conversation
- downloadMessagingAttachment - Download Attachment
- listAttachments - List Attachments
- getAttachment - Get Attachment
- listUsers - List Users
- getUser - Get User
- listConversationMessages - List Conversation Messages
- getMessage - Get Message
- sendMessage - Send Message
- proxyRequest - Proxy Request
- listStepLogs - List Step Logs
- getLog - Get Log
- listLogs - List Logs
- listPlatformLogs - List Platform Logs
- listScreeningPackages - List Screening Packages
- getScreeningPackage - Get Screening Package
- webhookScreeningResult - Webhook Screening Result
- createScreeningOrder - Create Screening Order
- listTickets - List Tickets
- createTicket - Create Ticket
- getTicket - Get Ticket
- updateTicket - Update Ticket
- listUsers - List Users
- getUser - Get User
- listComments - List Comments
- getComment - Get Comment
- downloadTicketingAttachment - Download Attachment
- listAttachments - List Attachments
- getAttachment - Get Attachment
- listTicketTypes - List Ticket Types
- getTicketType - Get Ticket Type
- listProjects - List Projects
- getProject - Get Project
- listProjectComponents - List Project Components
- getProjectComponent - Get Project Component
- listProjectTicketTypes - List Project Ticket Types
- listTicketStatuses - List Ticket Statuses
Some of the endpoints in this SDK support pagination. To use pagination, you can make your SDK calls using the callAsIterable
or callAsStream
methods.
For certain operations, you can also use the callAsStreamUnwrapped
method that streams individual page items directly.
Here's an example depicting the different ways to use pagination:
package hello.world;
import com.stackone.stackone_client_java.StackOne;
import com.stackone.stackone_client_java.models.components.Security;
import com.stackone.stackone_client_java.models.errors.*;
import com.stackone.stackone_client_java.models.operations.*;
import java.lang.Exception;
import java.lang.Iterable;
import java.time.OffsetDateTime;
public class Application {
public static void main(String[] args) throws Exception {
StackOne sdk = StackOne.builder()
.security(Security.builder()
.username("")
.password("")
.build())
.build();
HrisListCompaniesRequest req = HrisListCompaniesRequest.builder()
.xAccountId("<id>")
.fields("id,remote_id,name,full_name,display_name,created_at,updated_at")
.filter(HrisListCompaniesQueryParamFilter.builder()
.updatedAfter(OffsetDateTime.parse("2020-01-01T00:00:00.000Z"))
.build())
.build();
var b = sdk.hris().listCompanies()
.request(req);
// Iterate through all pages using a traditional for-each loop
// Each iteration returns a complete page response
Iterable<HrisListCompaniesResponse> iterable = b.callAsIterable();
for (HrisListCompaniesResponse page : iterable) {
// handle page
}
// Stream through all pages and process individual items
// callAsStreamUnwrapped() flattens pages into individual items
// Stream through pages without unwrapping (each item is a complete page)
b.callAsStream()
.forEach((HrisListCompaniesResponse page) -> {
// handle page
});
}
}
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, you can provide a RetryConfig
object through the retryConfig
builder method:
package hello.world;
import com.stackone.stackone_client_java.StackOne;
import com.stackone.stackone_client_java.models.components.*;
import com.stackone.stackone_client_java.models.errors.*;
import com.stackone.stackone_client_java.models.operations.StackoneCreateConnectSessionResponse;
import com.stackone.stackone_client_java.utils.BackoffStrategy;
import com.stackone.stackone_client_java.utils.RetryConfig;
import java.lang.Exception;
import java.util.List;
import java.util.concurrent.TimeUnit;
public class Application {
public static void main(String[] args) throws Exception {
StackOne sdk = StackOne.builder()
.security(Security.builder()
.username("")
.password("")
.build())
.build();
ConnectSessionCreate req = ConnectSessionCreate.builder()
.originOwnerId("<id>")
.originOwnerName("<value>")
.categories(List.of(
Categories.ATS,
Categories.HRIS,
Categories.DOCUMENTS,
Categories.CRM,
Categories.IAM,
Categories.MARKETING,
Categories.LMS,
Categories.IAM,
Categories.DOCUMENTS,
Categories.TICKETING,
Categories.SCREENING,
Categories.MESSAGING,
Categories.ACCOUNTING))
.type(Type.TEST)
.build();
StackoneCreateConnectSessionResponse res = sdk.connectSessions().createConnectSession()
.request(req)
.retryConfig(RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(1L, TimeUnit.MILLISECONDS)
.maxInterval(50L, TimeUnit.MILLISECONDS)
.maxElapsedTime(1000L, TimeUnit.MILLISECONDS)
.baseFactor(1.1)
.jitterFactor(0.15)
.retryConnectError(false)
.build())
.build())
.call();
if (res.connectSessionTokenAuthLink().isPresent()) {
// handle response
}
}
}
If you'd like to override the default retry strategy for all operations that support retries, you can provide a configuration at SDK initialization:
package hello.world;
import com.stackone.stackone_client_java.StackOne;
import com.stackone.stackone_client_java.models.components.*;
import com.stackone.stackone_client_java.models.errors.*;
import com.stackone.stackone_client_java.models.operations.StackoneCreateConnectSessionResponse;
import com.stackone.stackone_client_java.utils.BackoffStrategy;
import com.stackone.stackone_client_java.utils.RetryConfig;
import java.lang.Exception;
import java.util.List;
import java.util.concurrent.TimeUnit;
public class Application {
public static void main(String[] args) throws Exception {
StackOne sdk = StackOne.builder()
.retryConfig(RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(1L, TimeUnit.MILLISECONDS)
.maxInterval(50L, TimeUnit.MILLISECONDS)
.maxElapsedTime(1000L, TimeUnit.MILLISECONDS)
.baseFactor(1.1)
.jitterFactor(0.15)
.retryConnectError(false)
.build())
.build())
.security(Security.builder()
.username("")
.password("")
.build())
.build();
ConnectSessionCreate req = ConnectSessionCreate.builder()
.originOwnerId("<id>")
.originOwnerName("<value>")
.categories(List.of(
Categories.ATS,
Categories.HRIS,
Categories.DOCUMENTS,
Categories.CRM,
Categories.IAM,
Categories.MARKETING,
Categories.LMS,
Categories.IAM,
Categories.DOCUMENTS,
Categories.TICKETING,
Categories.SCREENING,
Categories.MESSAGING,
Categories.ACCOUNTING))
.type(Type.TEST)
.build();
StackoneCreateConnectSessionResponse res = sdk.connectSessions().createConnectSession()
.request(req)
.call();
if (res.connectSessionTokenAuthLink().isPresent()) {
// handle response
}
}
}
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 createConnectSession
method throws the following exceptions:
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/ForbiddenResponse | 403 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/RequestTimedOutResponse | 408 | application/json |
models/errors/ConflictResponse | 409 | application/json |
models/errors/UnprocessableEntityResponse | 422 | application/json |
models/errors/TooManyRequestsResponse | 429 | application/json |
models/errors/InternalServerErrorResponse | 500 | application/json |
models/errors/NotImplementedResponse | 501 | application/json |
models/errors/BadGatewayResponse | 502 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
package hello.world;
import com.stackone.stackone_client_java.StackOne;
import com.stackone.stackone_client_java.models.components.*;
import com.stackone.stackone_client_java.models.errors.*;
import com.stackone.stackone_client_java.models.operations.StackoneCreateConnectSessionResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
StackOne sdk = StackOne.builder()
.security(Security.builder()
.username("")
.password("")
.build())
.build();
ConnectSessionCreate req = ConnectSessionCreate.builder()
.originOwnerId("<id>")
.originOwnerName("<value>")
.categories(List.of(
Categories.ATS,
Categories.HRIS,
Categories.DOCUMENTS,
Categories.CRM,
Categories.IAM,
Categories.MARKETING,
Categories.LMS,
Categories.IAM,
Categories.DOCUMENTS,
Categories.TICKETING,
Categories.SCREENING,
Categories.MESSAGING,
Categories.ACCOUNTING))
.type(Type.TEST)
.build();
StackoneCreateConnectSessionResponse res = sdk.connectSessions().createConnectSession()
.request(req)
.call();
if (res.connectSessionTokenAuthLink().isPresent()) {
// handle response
}
}
}
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.stackone.stackone_client_java.StackOne;
import com.stackone.stackone_client_java.models.components.*;
import com.stackone.stackone_client_java.models.errors.*;
import com.stackone.stackone_client_java.models.operations.StackoneCreateConnectSessionResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
StackOne sdk = StackOne.builder()
.serverURL("https://api.stackone.com")
.security(Security.builder()
.username("")
.password("")
.build())
.build();
ConnectSessionCreate req = ConnectSessionCreate.builder()
.originOwnerId("<id>")
.originOwnerName("<value>")
.categories(List.of(
Categories.ATS,
Categories.HRIS,
Categories.DOCUMENTS,
Categories.CRM,
Categories.IAM,
Categories.MARKETING,
Categories.LMS,
Categories.IAM,
Categories.DOCUMENTS,
Categories.TICKETING,
Categories.SCREENING,
Categories.MESSAGING,
Categories.ACCOUNTING))
.type(Type.TEST)
.build();
StackoneCreateConnectSessionResponse res = sdk.connectSessions().createConnectSession()
.request(req)
.call();
if (res.connectSessionTokenAuthLink().isPresent()) {
// handle response
}
}
}
The SDK provides comprehensive asynchronous support using Java's CompletableFuture<T>
and Reactive Streams Publisher<T>
APIs. This design makes no assumptions about your choice of reactive toolkit, allowing seamless integration with any reactive library.
Why Use Async?
Asynchronous operations provide several key benefits:
- Non-blocking I/O: Your threads stay free for other work while operations are in flight
- Better resource utilization: Handle more concurrent operations with fewer threads
- Improved scalability: Build highly responsive applications that can handle thousands of concurrent requests
- Reactive integration: Works seamlessly with reactive streams and backpressure handling
Reactive Library Integration
The SDK returns Reactive Streams Publisher<T>
instances for operations dealing with streams involving multiple I/O interactions. We use Reactive Streams instead of JDK Flow API to provide broader compatibility with the reactive ecosystem, as most reactive libraries natively support Reactive Streams.
Why Reactive Streams over JDK Flow?
- Broader ecosystem compatibility: Most reactive libraries (Project Reactor, RxJava, Akka Streams, etc.) natively support Reactive Streams
- Industry standard: Reactive Streams is the de facto standard for reactive programming in Java
- Better interoperability: Seamless integration without additional adapters for most use cases
Integration with Popular Libraries:
- Project Reactor: Use
Flux.from(publisher)
to convert to Reactor types - RxJava: Use
Flowable.fromPublisher(publisher)
for RxJava integration - Akka Streams: Use
Source.fromPublisher(publisher)
for Akka Streams integration - Vert.x: Use
ReadStream.fromPublisher(vertx, publisher)
for Vert.x reactive streams - Mutiny: Use
Multi.createFrom().publisher(publisher)
for Quarkus Mutiny integration
For JDK Flow API Integration: If you need JDK Flow API compatibility (e.g., for Quarkus/Mutiny 2), you can use adapters:
// Convert Reactive Streams Publisher to Flow Publisher
Flow.Publisher<T> flowPublisher = FlowAdapters.toFlowPublisher(reactiveStreamsPublisher);
// Convert Flow Publisher to Reactive Streams Publisher
Publisher<T> reactiveStreamsPublisher = FlowAdapters.toPublisher(flowPublisher);
For standard single-response operations, the SDK returns CompletableFuture<T>
for straightforward async execution.
Supported Operations
Async support is available for:
- Server-sent Events: Stream real-time events with Reactive Streams
Publisher<T>
- JSONL Streaming: Process streaming JSON lines asynchronously
- Pagination: Iterate through paginated results using
callAsPublisher()
andcallAsPublisherUnwrapped()
- File Uploads: Upload files asynchronously with progress tracking
- File Downloads: Download files asynchronously with streaming support
- Standard Operations: All regular API calls return
CompletableFuture<T>
for async execution
This SDK supports the following security scheme globally:
Name | Type | Scheme |
---|---|---|
username password |
http | HTTP Basic |
You can set the security parameters through the security
builder method when initializing the SDK client instance. For example:
package hello.world;
import com.stackone.stackone_client_java.StackOne;
import com.stackone.stackone_client_java.models.components.*;
import com.stackone.stackone_client_java.models.errors.*;
import com.stackone.stackone_client_java.models.operations.StackoneCreateConnectSessionResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
StackOne sdk = StackOne.builder()
.security(Security.builder()
.username("")
.password("")
.build())
.build();
ConnectSessionCreate req = ConnectSessionCreate.builder()
.originOwnerId("<id>")
.originOwnerName("<value>")
.categories(List.of(
Categories.ATS,
Categories.HRIS,
Categories.DOCUMENTS,
Categories.CRM,
Categories.IAM,
Categories.MARKETING,
Categories.LMS,
Categories.IAM,
Categories.DOCUMENTS,
Categories.TICKETING,
Categories.SCREENING,
Categories.MESSAGING,
Categories.ACCOUNTING))
.type(Type.TEST)
.build();
StackoneCreateConnectSessionResponse res = sdk.connectSessions().createConnectSession()
.request(req)
.call();
if (res.connectSessionTokenAuthLink().isPresent()) {
// handle response
}
}
}
You can setup your SDK to emit debug logs for SDK requests and responses.
For request and response logging (especially json bodies), call enableHTTPDebugLogging(boolean)
on the SDK builder like so:
SDK.builder()
.enableHTTPDebugLogging(true)
.build();
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
.
NOTE: This is a convenience method that calls HTTPClient.enableDebugLogging()
. The SpeakeasyHTTPClient
honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting.
Another option is to set the System property -Djdk.httpclient.HttpClient.log=all
. However, this second option does not log bodies.
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. 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.