Users API
Users API documentation for JavaScript 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 GoodMemClient from '@pairsystems/goodmem-client';
let apiInstance = new GoodMemClient.UsersApi();
apiInstance.getCurrentUser().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});Parameters
This endpoint does not need any parameter.
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
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 GoodMemClient from '@pairsystems/goodmem-client';
let apiInstance = new GoodMemClient.UsersApi();
let id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the user to retrieve
apiInstance.getUser(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The unique identifier of the user to retrieve |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
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 GoodMemClient from '@pairsystems/goodmem-client';
let apiInstance = new GoodMemClient.UsersApi();
let email = "[email protected]"; // String | The email address of the user to retrieve
apiInstance.getUserByEmail(email).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| String | The email address of the user to retrieve |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json