A Java client library for interacting with the DatabunkerPro API.
- User management (create, get, update, delete)
- User request management
- App data management
- Legal basis and agreement management
- Processing activity management
- Connector management
- Group and role management
- Policy management
- Token management
- Audit management
- Tenant management
- Session management
- System configuration
- Bulk operations
- Easy to use Java API
- Thread-safe implementation
- Comprehensive test suite
- Java 11 or higher
- Maven 3.6 or higher
Add the following dependency to your pom.xml:
<dependency>
<groupId>org.databunkerpro</groupId>
<artifactId>databunkerpro-java</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>import org.databunkerpro.DatabunkerproApi;
import java.util.Map;
import java.util.HashMap;
public class Example {
public static void main(String[] args) {
String baseURL = "https://pro.databunker.org";
String xBunkerToken = "your-api-token";
String xBunkerTenant = "your-tenant-name";
try (DatabunkerproApi api = new DatabunkerproApi(baseURL, xBunkerToken, xBunkerTenant)) {
// Use the API here
} catch (Exception e) {
e.printStackTrace();
}
}
}Map<String, Object> profile = new HashMap<>();
profile.put("email", "user@example.com");
profile.put("name", "John Doe");
profile.put("phone", "+1234567890");
Map<String, Object> options = new HashMap<>();
options.put("groupname", "users");
options.put("rolename", "member");
Map<String, Object> result = api.createUser(profile, options, null);Map<String, Object> user = api.getUser("email", "user@example.com", null);Map<String, Object> updateProfile = new HashMap<>();
updateProfile.put("name", "John Smith");
updateProfile.put("phone", "+9876543210");
Map<String, Object> result = api.updateUser("email", "user@example.com", updateProfile, null);Map<String, Object> result = api.deleteUser("email", "user@example.com", null);To run the tests, you need to set the following environment variables:
export DATABUNKER_TENANT=your-tenant-name
export DATABUNKER_TOKEN=your-api-tokenThen run:
mvn test- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.