Skip to content

Commit 2080f51

Browse files
committed
add new API calls
1 parent f1a4115 commit 2080f51

1 file changed

Lines changed: 39 additions & 5 deletions

File tree

src/main/java/org/databunker/DatabunkerproApi.java

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,18 +316,17 @@ public Map<String, Object> deleteUsersBulk(Map<String, Object>[] users, Map<Stri
316316
}
317317

318318
/**
319-
* Searches for users using fuzzy matching
319+
* Searches for users using fuzzy matching. The mode is auto-detected from the identity value:
320+
* if it contains '@' it is treated as an email, otherwise it searches login, phone, and custom fields.
320321
*
321-
* @param mode User identification mode
322-
* @param identity User identifier to search for
322+
* @param identity User identifier to search for (email, login, phone, or custom value)
323323
* @param unlockuuid UUID from bulk list unlock for search authorization
324324
* @param requestMetadata Optional request metadata
325325
* @return The search results
326326
* @throws IOException If an I/O error occurs
327327
*/
328-
public Map<String, Object> searchUsers(String mode, String identity, String unlockuuid, Map<String, Object> requestMetadata) throws IOException {
328+
public Map<String, Object> searchUsers(String identity, String unlockuuid, Map<String, Object> requestMetadata) throws IOException {
329329
Map<String, Object> data = new HashMap<>();
330-
data.put("mode", mode);
331330
data.put("identity", identity);
332331
data.put("unlockuuid", unlockuuid);
333332
return makeRequest("UserSearch", data, requestMetadata);
@@ -1559,6 +1558,41 @@ public Map<String, Object> getSystemStats(Map<String, Object> requestMetadata) t
15591558
return makeRequest("SystemGetSystemStats", null, requestMetadata);
15601559
}
15611560

1561+
/**
1562+
* Gets user profiles across all tenants. Only accessible by the main tenant admin.
1563+
*
1564+
* @param mode User identification mode (login, email, phone, or custom; token is not supported)
1565+
* @param identity User identifier
1566+
* @param unlockuuid UUID from bulk list unlock for authorization
1567+
* @param requestMetadata Optional request metadata
1568+
* @return User profiles across all tenants
1569+
* @throws IOException If an I/O error occurs
1570+
*/
1571+
public Map<String, Object> getUserProfiles(String mode, String identity, String unlockuuid, Map<String, Object> requestMetadata) throws IOException {
1572+
Map<String, Object> data = new HashMap<>();
1573+
data.put("mode", mode);
1574+
data.put("identity", identity);
1575+
data.put("unlockuuid", unlockuuid);
1576+
return makeRequest("SystemGetUserProfiles", data, requestMetadata);
1577+
}
1578+
1579+
/**
1580+
* Fuzzy-searches user profiles across all tenants. Only accessible by the main tenant admin.
1581+
* Mode is auto-detected: email if identity contains '@', otherwise searches login, phone, and custom fields.
1582+
*
1583+
* @param identity User identifier to search for
1584+
* @param unlockuuid UUID from bulk list unlock for authorization
1585+
* @param requestMetadata Optional request metadata
1586+
* @return Matching user profiles across all tenants
1587+
* @throws IOException If an I/O error occurs
1588+
*/
1589+
public Map<String, Object> searchUserProfiles(String identity, String unlockuuid, Map<String, Object> requestMetadata) throws IOException {
1590+
Map<String, Object> data = new HashMap<>();
1591+
data.put("identity", identity);
1592+
data.put("unlockuuid", unlockuuid);
1593+
return makeRequest("SystemSearchUserProfiles", data, requestMetadata);
1594+
}
1595+
15621596
/**
15631597
* Gets user report
15641598
*

0 commit comments

Comments
 (0)