Freshchat-Entities

class freshchat.models.User(id: Optional[str] = None, created_time: Optional[str] = None, email: Optional[str] = None, first_name: Optional[str] = None, last_name: Optional[str] = None, phone: Optional[str] = None, avatar: Optional[Dict[AnyStr, AnyStr]] = <factory>, social_profiles: Optional[List[Dict[AnyStr, AnyStr]]] = <factory>, properties: Optional[List[Dict[AnyStr, AnyStr]]] = <factory>)

Class which represents a freshchat user. A user can be an external user or an agent

classmethod create(client: freshchat.client.client.FreshChatClient, **kwargs) → freshchat.models.User

Creates a new user instance with the given kwargs

classmethod get(client: freshchat.client.client.FreshChatClient, user_id: str) → freshchat.models.User

Returns an existing user based on the given user_id

class freshchat.models.Message(created_time: Optional[str] = None, id: Optional[str] = None, app_id: str = None, actor_type: Optional[str] = 'user', actor_id: str = None, channel_id: Optional[str] = None, conversation_id: Optional[str] = None, message_type: str = 'normal', message_parts: List[Dict[AnyStr, AnyStr]] = <factory>)

Class which represents freshchat message format

class freshchat.models.Conversation(conversation_id: Optional[str] = None, app_id: str = None, channel_id: str = None, status: Optional[str] = 'new', agents: Optional[List[freshchat.models.User]] = <factory>, users: List[freshchat.models.User] = <factory>, messages: List[freshchat.models.Message] = <factory>)

Class which represents freshchat conversation format

classmethod create(client: freshchat.client.client.FreshChatClient, user_id: str, channel_id: Optional[str] = None, init_message: Optional[str] = None) → freshchat.models.Conversation

Create a new conversation instance :param client: FreshChatClient to make the necessary requests :param user_id: the id of the user who creates the conversation :param channel_id: the id of the channel which the conversation will be assigned :param init_message: the initial message of the conversation :return: an instance of the class with the additional information returned from Freshchat API

classmethod get(client: freshchat.client.client.FreshChatClient, conversation_id: str, user_id: str) → freshchat.models.Conversation

Method which returns an existing conversation based on the conversation_id :param client: FreshChatClient to make the necessary requests :param conversation_id: the id of the conversation :param user_id: the id of the user :return: an instance of the class with the additional information returned from Freshchat API

get_endpoint

Property returns endpoint for the GET method :return:

resolve(client: freshchat.client.client.FreshChatClient) → freshchat.models.Conversation

Method which resolves the existing Conversation :param client: FreshChatClient to make the necessary requests :return: an instance of the class with the additional information returned from Freshchat API

send(client: freshchat.client.client.FreshChatClient, message: str) → freshchat.models.Message

Sends a message to an existing conversation :param client: FreshChatClient to make the necessary requests :param message: message to be send in the conversation :return: am instance of the Message class with the additional information returned from Freshchat API

class freshchat.models.Group(id: Optional[str] = None, name: Optional[str] = None, description: Optional[str] = None, routing_type: Optional[str] = None)

Class which represents freshchat group format

class freshchat.models.Channels(channels: List[freshchat.models.Channel] = <factory>, pagination: Optional[Dict[AnyStr, AnyStr]] = <factory>, links: Optional[Dict[AnyStr, AnyStr]] = <factory>, last_page: Optional[Dict[AnyStr, AnyStr]] = <factory>)

Class which represents freshchat channels. It is the returning value of get channels request

classmethod get(client: freshchat.client.client.FreshChatClient) → List[T]

Returns a list of Channel