Skip to content
Merged
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
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.

### Added
- Support for new version 3.7.
- New method `request_welcome_message` in customer-api v3.6 and v3.7.
- New method `delete_event` in customer-api v3.6.
- New methods in configuration-api v3.6 for greetings: `create_greeting`, `delete_greeting`, `get_greeting`, `update_greeting`, `list_greetings`.
- New methods in agent-api v3.6: `send_thinking_indicator`, `send_message_preview`.
Expand All @@ -25,6 +26,7 @@ All notable changes to this project will be documented in this file.
### Removed
- Support for version 3.3.
- Removed support for billing-api.
- Support `get_predicted_agent` in customer-api v3.7.
- Support for `create_customer` method removed in agent-api v3.6 and later.
- Support for `incoming_customer` webhook removed in v3.6 and later.

Expand Down
16 changes: 16 additions & 0 deletions livechat/customer/rtm/api/v36.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,22 @@ def get_predicted_agent(self, payload: dict = None) -> RtmResponse:
'action': 'get_predicted_agent',
'payload': {} if payload is None else payload
})

def request_welcome_message(self, payload: dict = None) -> RtmResponse:
''' Requests a welcome message.

Args:
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)
'''
return self.ws.send({
'action': 'request_welcome_message',
'payload': {} if payload is None else payload
})

def get_url_info(self,
url: str = None,
Expand Down
6 changes: 3 additions & 3 deletions livechat/customer/rtm/api/v37.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,8 @@ def get_form(self,
payload = prepare_payload(locals())
return self.ws.send({'action': 'get_form', 'payload': payload})

def get_predicted_agent(self, payload: dict = None) -> RtmResponse:
''' Gets the predicted Agent - the one the Customer will chat with when the chat starts.
def request_welcome_message(self, payload: dict = None) -> RtmResponse:
''' Requests a welcome message.

Args:
payload (dict): Custom payload to be used as request's data.
Expand All @@ -602,7 +602,7 @@ def get_predicted_agent(self, payload: dict = None) -> RtmResponse:
`type`, `success` and `payload` properties)
'''
return self.ws.send({
'action': 'get_predicted_agent',
'action': 'request_welcome_message',
'payload': {} if payload is None else payload
})

Expand Down
22 changes: 22 additions & 0 deletions livechat/customer/web/api/v36.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,28 @@ def get_predicted_agent(self,
f'{self.api_url}/get_predicted_agent{self.query_string}',
json={} if payload is None else payload,
headers=headers)

def request_welcome_message(self,
payload: dict = None,
headers: dict = None) -> httpx.Response:
''' Requests a welcome message.
To use this method, the Customer needs to be logged in, which can be done via the `login` method.

Args:
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.
'''
return self.session.post(
f'{self.api_url}/request_welcome_message{self.query_string}',
json={} if payload is None else payload,
headers=headers)

def get_url_info(self,
url: str = None,
Expand Down
6 changes: 3 additions & 3 deletions livechat/customer/web/api/v37.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,10 +846,10 @@ def get_form(self,
json=payload,
headers=headers)

def get_predicted_agent(self,
def request_welcome_message(self,
payload: dict = None,
headers: dict = None) -> httpx.Response:
''' Gets the predicted Agent - the one the Customer will chat with when the chat starts.
''' Requests a welcome message.
To use this method, the Customer needs to be logged in, which can be done via the `login` method.

Args:
Expand All @@ -864,7 +864,7 @@ def get_predicted_agent(self,
which contains a server’s response to an HTTP request.
'''
return self.session.post(
f'{self.api_url}/get_predicted_agent{self.query_string}',
f'{self.api_url}/request_welcome_message{self.query_string}',
json={} if payload is None else payload,
headers=headers)

Expand Down