Dear Zoom Developer Support and Community,
I hope this message finds you well. I'm encountering an issue with my User-Managed Zoom App where I'm unable to retrieve chat messages, despite having the necessary scopes, successful API calls, and adhering to rate limits. I'd greatly appreciate any insights or assistance you could provide.
App Details:
- Type: Global App (User-Managed)
- Main Functionality: Chatbot for Zoom Chat
Current Behavior:
1. The app successfully authenticates and obtains access tokens.
2. Sending messages to both personal chats and channels works correctly.
3. Listing channels and retrieving channel IDs is successful.
4. However, when trying to retrieve messages (both personal and channel), the API returns an empty list, despite messages being present.
Expected Behavior:
The app should be able to retrieve recent messages from both personal chats and channels.
Steps to Reproduce:
1. Authenticate the app and obtain access token using the OAuth 2.0 flow.
2. Call the GET /chat/users/me/messages endpoint with appropriate parameters for both personal messages and channel messages.
3. Observe that the response is always an empty message list for both types.
Code Snippet (Python):
```python
def get_channel_messages(channel_id: str, config: Dict[str, Any], start_date: Optional[datetime] = None, page_size: int = 50, next_page_token: Optional[str] = None, is_personal: bool = False) -> Tuple[Optional[List[Dict[str, Any]]], Optional[str]]:
try:
access_token = token_manager.get_access_token(config)
url = "https://api.zoom.us/v2/chat/users/me/messages"
headers = {
'Authorization': f'Bearer {access_token}'
}
params = {
'page_size': page_size,
'start_date': (start_date or datetime.utcnow() - timedelta(days=7)).isoformat()
}
if is_personal:
params['to_contact'] = channel_id # For personal messages
else:
params['to_channel'] = channel_id # For channel messages
if next_page_token:
params['next_page_token'] = next_page_token
response = requests.get(url, headers=headers, params=params)
logging.info(f"API Response: Status {response.status_code}, Content: {response.text}")
if response.status_code == 200:
data = response.json()
messages = data.get('messages', [])
next_page_token = data.get('next_page_token')
return messages, next_page_token
else:
logging.error(f"Error retrieving messages: {response.status_code} - {response.text}")
return None, None
except Exception as e:
logging.error(f"Error during API call to retrieve messages: {e}")
return None, None
API Responses:
- For personal messages:
1{
2 "date": "2024-10-24",
3 "page_size": 50,
4 "next_page_token": "",
5 "messages": []
6}
- For channel messages:
1{
2 "date": "2024-10-24",
3 "page_size": 50,
4 "next_page_token": "",
5 "messages": []
6}
API URLs Used:
- OAuth 2.0 Authorization: Error - Zoom
- Token Exchange: https://zoom.us/oauth/token
- Refresh Token: https://zoom.us/oauth/token
- Get Messages: https://api.zoom.us/v2/chat/users/me/messages
Scopes Used: team_chat:read:user_message, team_chat:read:list_user_messages, team_chat:read:channel, team_chat:read:list_user_channels, chat_message:read, imchat:userapp (among others)
Troubleshooting Steps Taken:
- Verified all required scopes are enabled.
- Confirmed successful authentication and token retrieval.
- Tested with various time ranges (up to 7 days).
- Verified that messages exist in the tested channels and time ranges.
- Checked logs for any errors (none found, all requests return 200 OK).
- Tested with both user_id and member_id as per the March 2023 API updates.
- Ensured compliance with API rate limits (staying well below the limits).
Additional Information:
- We’ve implemented the changes from the March 2023 update, using member_id instead of user_id where applicable.
- Our application strictly adheres to the API rate limits, making significantly fewer requests than the allowed maximum.
- We’ve tested retrieving messages for both personal chats (using ‘to_contact’) and group discussions (using ‘to_channel’), but both return empty lists despite messages being present.
Questions:
- Are there any known issues with retrieving messages for User-Managed apps?
- Could there be any account-level settings affecting message retrieval?
- Are there any additional scopes or permissions required that I might be missing?
- Is there a difference in how personal messages and channel messages should be retrieved?
- Are there any specific headers or parameters we should include that aren’t documented?
Any assistance or guidance would be greatly appreciated. I’m happy to provide any additional information, logs, or conduct further tests if needed.
Thank you for your time and support!
Best regards,