https://github.com/ibrahimbutt/workos-client-java
A Java client library for WorkOS API, leveraging Spring's RestTemplate for streamlined integration and comprehensive access to WorkOS services in Java and Spring Boot applications.
https://github.com/ibrahimbutt/workos-client-java
Last synced: 11 months ago
JSON representation
A Java client library for WorkOS API, leveraging Spring's RestTemplate for streamlined integration and comprehensive access to WorkOS services in Java and Spring Boot applications.
- Host: GitHub
- URL: https://github.com/ibrahimbutt/workos-client-java
- Owner: ibrahimbutt
- Created: 2024-03-03T14:33:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-11T23:24:54.000Z (over 2 years ago)
- Last Synced: 2025-07-01T21:03:49.164Z (12 months ago)
- Language: Java
- Homepage: https://workos.com
- Size: 143 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# workos-client
External User Management API
- API version: 1.0.0
API for managing user information
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
## Requirements
Building the API client library requires:
1. Java 1.8+
2. Maven/Gradle
## Installation
To install the API client library to your local Maven repository, simply execute:
```shell
mvn clean install
```
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
```shell
mvn clean deploy
```
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
### Maven users
Add this dependency to your project's POM:
```xml
com.madebyibrahim
workos-client
0.1.0
compile
```
### Gradle users
Add this dependency to your project's build file:
```groovy
repositories {
mavenCentral() // Needed if the 'workos-client' jar has been published to maven central.
mavenLocal() // Needed if the 'workos-client' jar has been published to the local maven repo.
}
dependencies {
implementation "com.madebyibrahim:workos-client:0.1.0"
}
```
### Others
At first generate the JAR by executing:
```shell
mvn clean package
```
Then manually install the following JARs:
- `target/workos-client-0.1.0.jar`
- `target/lib/*.jar`
## Getting Started
Please follow the [installation](#installation) instruction and execute the following Java code:
```java
import com.madebyibrahim.workosclient.*;
import com.madebyibrahim.workosclient.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UsersApi;
public class UsersApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.workos.com");
UsersApi apiInstance = new UsersApi(defaultClient);
AuthenticateUserRequest authenticateUserRequest = new AuthenticateUserRequest(); // AuthenticateUserRequest |
try {
AuthenticatedUserResponse result = apiInstance.authenticateUser(authenticateUserRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#authenticateUser");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
## Documentation for API Endpoints
All URIs are relative to *https://api.workos.com*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*UsersApi* | [**authenticateUser**](docs/UsersApi.md#authenticateUser) | **POST** /user_management/authenticate | Authenticate a user
*UsersApi* | [**confirmEmail**](docs/UsersApi.md#confirmEmail) | **POST** /user_management/users/{id}/email_verification/confirm | Confirm a user's email address
*UsersApi* | [**createUser**](docs/UsersApi.md#createUser) | **POST** /user_management/users | Create a new user
*UsersApi* | [**deleteUser**](docs/UsersApi.md#deleteUser) | **DELETE** /user_management/users/{id} | Delete a user by ID
*UsersApi* | [**getUser**](docs/UsersApi.md#getUser) | **GET** /user_management/users/{id} | Get a user by ID
*UsersApi* | [**listUsers**](docs/UsersApi.md#listUsers) | **GET** /user_management/users | Get all users
*UsersApi* | [**sendVerificationEmail**](docs/UsersApi.md#sendVerificationEmail) | **POST** /user_management/users/{id}/email_verification/send | Send a verification email
*UsersApi* | [**updateUser**](docs/UsersApi.md#updateUser) | **PUT** /user_management/users/{id} | Update a user by ID
## Documentation for Models
- [AuthenticateUserRequest](docs/AuthenticateUserRequest.md)
- [AuthenticatedUserResponse](docs/AuthenticatedUserResponse.md)
- [ConfirmEmailRequest](docs/ConfirmEmailRequest.md)
- [CreateUserRequest](docs/CreateUserRequest.md)
- [EmailVerificationCodeAuthenticationRequest](docs/EmailVerificationCodeAuthenticationRequest.md)
- [EmailVerificationRequiredResponse](docs/EmailVerificationRequiredResponse.md)
- [ListUsers200Response](docs/ListUsers200Response.md)
- [ListUsers200ResponseListMetadata](docs/ListUsers200ResponseListMetadata.md)
- [PasswordAuthenticationRequest](docs/PasswordAuthenticationRequest.md)
- [UpdateUserRequest](docs/UpdateUserRequest.md)
- [User](docs/User.md)
## Documentation for Authorization
Authentication schemes defined for the API:
### BearerAuth
- **Type**: HTTP Bearer Token authentication
## Recommendation
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
## Author