Users API
Users API documentation for Python SDK
All URIs are relative to http://localhost:8080
| Method | HTTP request | Description |
|---|---|---|
| get_current_user | GET /v1/users/me | Get current user profile |
| get_user | GET /v1/users/{id} | Get a user by ID |
| get_user_by_email | GET /v1/users/email/{email} | Get user by email address |
get_current_user
UserResponse get_current_user()
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
- Api Key Authentication (ApiKeyAuth):
import goodmem_client
from goodmem_client.models.user_response import UserResponse
from goodmem_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8080/v1/default
# See configuration.py for a list of all supported configuration parameters.
configuration = goodmem_client.Configuration(
host = "http://localhost:8080/v1/default"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with goodmem_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = goodmem_client.UsersApi(api_client)
try:
# Get current user profile
api_response = api_instance.get_current_user()
print("The response of UsersApi->get_current_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsersApi->get_current_user: %s\n" % e)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 | - |
get_user
UserResponse get_user(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
- Api Key Authentication (ApiKeyAuth):
import goodmem_client
from goodmem_client.models.user_response import UserResponse
from goodmem_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8080/v1/default
# See configuration.py for a list of all supported configuration parameters.
configuration = goodmem_client.Configuration(
host = "http://localhost:8080/v1/default"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with goodmem_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = goodmem_client.UsersApi(api_client)
id = '550e8400-e29b-41d4-a716-446655440000' # str | The unique identifier of the user to retrieve
try:
# Get a user by ID
api_response = api_instance.get_user(id)
print("The response of UsersApi->get_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsersApi->get_user: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | 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 | - |
get_user_by_email
UserResponse get_user_by_email(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
- Api Key Authentication (ApiKeyAuth):
import goodmem_client
from goodmem_client.models.user_response import UserResponse
from goodmem_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8080/v1/default
# See configuration.py for a list of all supported configuration parameters.
configuration = goodmem_client.Configuration(
host = "http://localhost:8080/v1/default"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with goodmem_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = goodmem_client.UsersApi(api_client)
email = '[email protected]' # str | The email address of the user to retrieve
try:
# Get user by email address
api_response = api_instance.get_user_by_email(email)
print("The response of UsersApi->get_user_by_email:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsersApi->get_user_by_email: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| str | 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 | - |