Skip to content

Conversations API

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

MethodHTTP requestDescription
get_conversationGET /conversations/Get Conversation
list_conversationsGET /conversationsList Conversations

get_conversation

Conversation get_conversation(conversation_id)

Get Conversation

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.conversation import Conversation
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.ConversationsApi(api_client)
    conversation_id = 'conversation_id_example' # str | 

    try:
        # Get Conversation
        api_response = api_instance.get_conversation(conversation_id)
        print("The response of ConversationsApi->get_conversation:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConversationsApi->get_conversation: %s\n" % e)

Parameters

NameTypeDescriptionNotes
conversation_idstr

Return type

Conversation

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_conversations

PageConversation list_conversations(id=id, project_id=project_id, study_id=study_id, user_interview_id=user_interview_id, feedback_type=feedback_type, query=query, page=page, size=size)

List Conversations

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.conversation_feedback_type import ConversationFeedbackType
from syntheticusers.models.page_conversation import PageConversation
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.ConversationsApi(api_client)
    id = 'id_example' # str | Comma-separated list of studies IDs (optional)
    project_id = 'project_id_example' # str | Comma-separated list of project IDs (optional)
    study_id = 'study_id_example' # str | Comma-separated list of study IDs (optional)
    user_interview_id = 'user_interview_id_example' # str | Comma-separated list of userInterview IDs (optional)
    feedback_type = syntheticusers.ConversationFeedbackType() # ConversationFeedbackType | Filter by feedback type (optional)
    query = 'query_example' # str | Filter by text (optional)
    page = 1 # int | Page number (optional) (default to 1)
    size = 50 # int | Page size (optional) (default to 50)

    try:
        # List Conversations
        api_response = api_instance.list_conversations(id=id, project_id=project_id, study_id=study_id, user_interview_id=user_interview_id, feedback_type=feedback_type, query=query, page=page, size=size)
        print("The response of ConversationsApi->list_conversations:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConversationsApi->list_conversations: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrComma-separated list of studies IDs[optional]
project_idstrComma-separated list of project IDs[optional]
study_idstrComma-separated list of study IDs[optional]
user_interview_idstrComma-separated list of userInterview IDs[optional]
feedback_typeConversationFeedbackTypeFilter by feedback type[optional]
querystrFilter by text[optional]
pageintPage number[optional] [default to 1]
sizeintPage size[optional] [default to 50]

Return type

PageConversation

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.