Skip to content

Users API

All URIs are relative to https://api.syntheticusers.com/api/v1

MethodHTTP requestDescription
get_userGET /users/Get User
list_usersGET /usersList Users

get_user

User get_user(user_id, id, email, email_validated, created_at, generated_counter)

Get User

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.user import User
from syntheticusers.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
    host = "https://api.syntheticusers.com/api/v1"
)

# 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 Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = syntheticusers.UsersApi(api_client)
    user_id = 'user_id_example' # str | 
    id = 'id_example' # str | 
    email = 'email_example' # str | 
    email_validated = True # bool | 
    created_at = '2013-10-20T19:20:30+01:00' # datetime | 
    generated_counter = 56 # int | 

    try:
        # Get User
        api_response = api_instance.get_user(user_id, id, email, email_validated, created_at, generated_counter)
        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

NameTypeDescriptionNotes
user_idstr
idstr
emailstr
email_validatedbool
created_atdatetime
generated_counterint

Return type

User

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
422Validation Error-

[Back to top] [Back to API list] [Back to SDK]

list_users

PageUser list_users(id=id, workspace_id=workspace_id, page=page, size=size)

List Users

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.page_user import PageUser
from syntheticusers.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
    host = "https://api.syntheticusers.com/api/v1"
)

# 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 Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = syntheticusers.UsersApi(api_client)
    id = 'id_example' # str | Comma-separated list of user IDs (optional)
    workspace_id = 'workspace_id_example' # str | Comma-separated list of workspace IDs (optional)
    page = 1 # int | Page number (optional) (default to 1)
    size = 50 # int | Page size (optional) (default to 50)

    try:
        # List Users
        api_response = api_instance.list_users(id=id, workspace_id=workspace_id, page=page, size=size)
        print("The response of UsersApi->list_users:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->list_users: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrComma-separated list of user IDs[optional]
workspace_idstrComma-separated list of workspace IDs[optional]
pageintPage number[optional] [default to 1]
sizeintPage size[optional] [default to 50]

Return type

PageUser

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
422Validation Error-

[Back to top] [Back to API list] [Back to SDK]

Released under the MIT License.