04-12-2024 04:00 AM
I am trying to fetch messages from my webex room. Those messages should be in given date range. EX. I want to fetch all the messages we got in a day. I provided the date range but its not working as expected, I could see messages for 3-4 days. I am using below API.
String apiUrl = "https://webexapis.com/v1/messages";
String queryParams = "?roomId=" + "id" +
"&created=" + fromDate + "-" + toDate;
Solved! Go to Solution.
04-12-2024 04:17 AM
If the before and beforeMessage params don't suit, then the only other option is to pull all messages on your side and write a script to go through the "created" field that's returned for each message in the response so you can pull whichever messages within a date range that you want to get.
05-02-2024 04:33 AM
String parentId = message.getParentId();
This is the way I am trying to retrieve parentId
05-02-2024 04:59 AM
What is "message" in this case (its value) and what is the definition of getParentId() function? In other words, what is the code for that function?
Are you using an SDK maybe? If so, which one?
05-06-2024 10:22 AM
If a message's parentId is null, that should indicate it is either the root message of a thread or not threaded at all. It is not possible to directly query for the opposite relationship, i.e. the child/children messages for a particular message - you would need to retrieve all messages then construct a graph of parent/child relationships to get a complete picture.
If you are seeing a message that is definitely a reply, but that has no parentId, I think that would be unexpected - might want to open a support ticket so the Webex dev support folks can investigate the message in question and peek into any helpful logs (be sure to have a transaction Id from an API response handy.) I'm not sure what happens to a message's parentId if the parent message is deleted and/or the message sender leaves the organization - could be a valid scenario.
This sample may be helfpul as it does both date-range message selection and thread reconstruction: https://github.com/CiscoDevNet/webex-messaging-activity-report-sample
05-02-2024 04:33 AM
I am getting parentId null even if the message is a reply to another message
04-16-2024 12:44 AM
I mean, I want to find out if the message is part of some message thread or is a new message. All this using API
04-16-2024 12:42 AM
How can I find replies for message in webex room using API
04-16-2024 12:47 AM
The list message endpoint has a query parameter parentId. It points to the parent message.
Same in the response. If it's empty, it is a thread's root.
04-12-2024 04:07 AM
Then how can I get the messages arrived in particular date range. before param will not give the required time range messages
04-12-2024 04:17 AM
If the before and beforeMessage params don't suit, then the only other option is to pull all messages on your side and write a script to go through the "created" field that's returned for each message in the response so you can pull whichever messages within a date range that you want to get.
04-12-2024 04:03 AM
The /messages API you're using doesn't have a "created" parameter. Please see here for what it does have: https://developer.webex.com/docs/api/v1/messages/list-messages.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide