WebexPythonSDK icon indicating copy to clipboard operation
WebexPythonSDK copied to clipboard

Issues retrieving the correct number of messages.

Open cp-community opened this issue 5 years ago • 0 comments

I am having two separate but possibly related issues when getting messages.

The first issue I'm having is that api.messages.list(roomId=room.id) does not download the default of 50 messages, it downloads all messages. If I set max= that number is ignored.

The second issue is that the number of direct messages downloaded is 50 per person. I can't seem to find a way with this SDK to increase the number of direct messages to get.

Could you help me with these issues?

Here is my code to get the messages.

for room in room_list:
    room_msg_list = api.messages.list(roomId=room.id, max=100)
    messages_dict[room.title] = []
    for msg in room_msg_list:
        messages_dict[room.title].append(msg)

And here is my code to get the direct messages

for dm_room in list_dm_room_list:
    if dm_room.title in people_list:
        dm_room_msg_list = api.messages.list_direct(personEmail=people_dict[dm_room.title]['email'])
        dm_messages_dict[dm_room.title] = []
        messages_list = []
        for msg in dm_room_msg_list:
            dm_messages_dict[dm_room.title].append(msg)

cp-community avatar Jan 21 '21 09:01 cp-community