Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
- New methods in agent-api v3.6: `send_thinking_indicator`, `send_message_preview`.
- New methods in configuration-api v3.7 for canned responses: `create_canned_response`, `update_canned_response`, `list_canned_responses`, `delete_canned_response`.
- New method `request_thread_summary` in agent-api v3.6 and v3.7.
- New method `get_thread_transcript` in agent-api v3.6 and v3.7.
- New flag `name_is_default` in method `update_customer` in customer-api v3.6 and v3.7.
- New field `phone_number` in method `update_customer` in customer-api v3.6 and v3.7.
- New method in reports-api v3.7: report `campaigns_conversion`.
Expand Down
23 changes: 23 additions & 0 deletions livechat/agent/rtm/api/v36.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,29 @@ def request_thread_summary(self,
'payload': payload
})

def get_thread_transcript(self,
chat_id: str = None,
thread_id: str = None,
payload: dict = None) -> RtmResponse:
''' Returns a plain-text transcript of a given thread.

Args:
chat_id (str): ID of the chat the thread belongs to.
thread_id (str): ID of the thread to return the transcript for.
payload (dict): Custom payload to be used as request's data.
It overrides all other parameters provided for the method.

Returns:
RtmResponse: RTM response structure (`request_id`, `action`,
`type`, `success` and `payload` properties)
'''
if payload is None:
payload = prepare_payload(locals())
return self.ws.send({
'action': 'get_thread_transcript',
'payload': payload
})

# Properties

def update_chat_properties(self,
Expand Down
23 changes: 23 additions & 0 deletions livechat/agent/rtm/api/v37.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,29 @@ def request_thread_summary(self,
'payload': payload
})

def get_thread_transcript(self,
chat_id: str = None,
thread_id: str = None,
payload: dict = None) -> RtmResponse:
''' Returns a plain-text transcript of a given thread.

Args:
chat_id (str): ID of the chat the thread belongs to.
thread_id (str): ID of the thread to return the transcript for.
payload (dict): Custom payload to be used as request's data.
It overrides all other parameters provided for the method.

Returns:
RtmResponse: RTM response structure (`request_id`, `action`,
`type`, `success` and `payload` properties)
'''
if payload is None:
payload = prepare_payload(locals())
return self.ws.send({
'action': 'get_thread_transcript',
'payload': payload
})

# Properties

def update_chat_properties(self,
Expand Down
25 changes: 25 additions & 0 deletions livechat/agent/web/api/v36.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,31 @@ def request_thread_summary(self,
json=payload,
headers=headers)

def get_thread_transcript(self,
chat_id: str = None,
thread_id: str = None,
payload: dict = None,
headers: dict = None) -> httpx.Response:
''' Returns a plain-text transcript of a given thread.

Args:
chat_id (str): ID of the chat the thread belongs to.
thread_id (str): ID of the thread to return the transcript for.
payload (dict): Custom payload to be used as request's data.
It overrides all other parameters provided for the method.
headers (dict): Custom headers to be used with session headers.
They will be merged with session-level values that are set,
however, these method-level parameters will not be persisted across requests.

Returns:
httpx.Response: The Response object from `httpx` library,
which contains a server's response to an HTTP request. '''
if payload is None:
payload = prepare_payload(locals())
return self.session.post(f'{self.api_url}/get_thread_transcript',
json=payload,
headers=headers)

# Properties

def update_chat_properties(self,
Expand Down
25 changes: 25 additions & 0 deletions livechat/agent/web/api/v37.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,31 @@ def request_thread_summary(self,
json=payload,
headers=headers)

def get_thread_transcript(self,
chat_id: str = None,
thread_id: str = None,
payload: dict = None,
headers: dict = None) -> httpx.Response:
''' Returns a plain-text transcript of a given thread.

Args:
chat_id (str): ID of the chat the thread belongs to.
thread_id (str): ID of the thread to return the transcript for.
payload (dict): Custom payload to be used as request's data.
It overrides all other parameters provided for the method.
headers (dict): Custom headers to be used with session headers.
They will be merged with session-level values that are set,
however, these method-level parameters will not be persisted across requests.

Returns:
httpx.Response: The Response object from `httpx` library,
which contains a server's response to an HTTP request. '''
if payload is None:
payload = prepare_payload(locals())
return self.session.post(f'{self.api_url}/get_thread_transcript',
json=payload,
headers=headers)

# Properties

def update_chat_properties(self,
Expand Down
Loading