Users API
Users API documentation for Java SDK
All URIs are relative to *http://localhost:8080*
| Method | HTTP request | Description |
|---|---|---|
| getCurrentUser | GET /v1/users/me | Get current user profile |
| getUser | GET /v1/users/{id} | Get a user by ID |
| getUserByEmail | GET /v1/users/email/{email} | Get user by email address |
getCurrentUser
UserResponse getCurrentUser()
Get current user profile
Retrieves the authenticated user's profile information including email, display name, and creation time. This endpoint does not require any parameters as it automatically returns the caller's information.
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.auth.*;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.UsersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("[http://localhost:8080](http://localhost:8080)");
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
UsersApi apiInstance = new UsersApi(defaultClient);
try {
UserResponse result = apiInstance.getCurrentUser();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getCurrentUser");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved current user profile | - |
| 401 | Unauthorized - invalid or missing API key | - |
getUser
UserResponse getUser(id)
Get a user by ID
Retrieves a specific user by their unique identifier. This endpoint only accepts user IDs - for email-based lookup, use GET /v1/users/email/{email}. For getting your own profile, use GET /v1/users/me.
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.auth.*;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.UsersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("[http://localhost:8080](http://localhost:8080)");
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
UsersApi apiInstance = new UsersApi(defaultClient);
String id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the user to retrieve
try {
UserResponse result = apiInstance.getUser(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUser");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The unique identifier of the user to retrieve |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved user | - |
| 400 | Invalid request - user ID in invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to view this user's information | - |
| 404 | Not found - user with the specified ID does not exist | - |
getUserByEmail
UserResponse getUserByEmail(email)
Get user by email address
Retrieves a user by their email address. The email must be URL-encoded if it contains special characters.
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.auth.*;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.UsersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("[http://localhost:8080](http://localhost:8080)");
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
UsersApi apiInstance = new UsersApi(defaultClient);
String email = "[email protected]"; // String | The email address of the user to retrieve
try {
UserResponse result = apiInstance.getUserByEmail(email);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUserByEmail");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| String | The email address of the user to retrieve |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved user | - |
| 400 | Invalid request - email parameter is missing or empty | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to view this user's information | - |
| 404 | Not found - user with the specified email does not exist | - |