Skip to content

Commit c2cf8ca

Browse files
committedAug 22, 2024
docstring and readme update for RCS messages
1 parent be2d371 commit c2cf8ca

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed
 

‎README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,18 @@ client.messages.send_message({
212212

213213
### Revoke an RCS Message
214214

215+
To mark a WhatsApp message as read, you must override the default `vonage.Client.api_host` attribute. Override it to correspond to the region where the WhatsApp number you're using is hosted.
216+
215217
```python
218+
# Override api_host attribute for EU region
219+
client.api_host('api-eu.vonage.com')
220+
216221
client.messages.revoke_outbound_message('MY-MESSAGE-ID')
217222
```
218223

219224
### Send an audio file via WhatsApp
220225

221-
You will need a WhatsApp Business Account to use WhatsApp messaging. WhatsApp restrictions mean that you
222-
must send a template message to a user if they have not previously messaged you, but you can send any message
223-
type to a user if they have messaged your business number in the last 24 hours.
226+
You will need a WhatsApp Business Account to use WhatsApp messaging. WhatsApp restrictions mean that you must send a template message to a user if they have not previously messaged you, but you can send any message type to a user if they have messaged your business number in the last 24 hours.
224227

225228
```python
226229
client.messages.send_message({

‎src/vonage/messages.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def send_message(self, params: dict):
5454
def revoke_outbound_rcs_message(self, message_uuid: str) -> None:
5555
"""Revoke an outbound RCS message.
5656
57+
Note: to use this method, update the `api_host` attribute of the `vonage.Client` instance
58+
to the API endpoint corresponding to the region where the WhatsApp number is hosted.
59+
60+
For example, to use the EU API endpoint, set the `api_host`
61+
attribute to 'api-eu.vonage.com'.
62+
5763
Args:
5864
message_uuid (str): The UUID of the message to revoke.
5965
"""
@@ -71,7 +77,7 @@ def mark_whatsapp_message_read(self, message_uuid: str) -> None:
7177
to the API endpoint corresponding to the region where the WhatsApp number is hosted.
7278
7379
For example, to use the EU API endpoint, set the `api_host`
74-
attribute to 'https://api-eu.vonage.com'.
80+
attribute to 'api-eu.vonage.com'.
7581
7682
Args:
7783
message_uuid (str): The UUID of the message to mark as read.

0 commit comments

Comments
 (0)