Can I search for active SMS messages that are in a threading state? If so can you search for them by telephone number?
Any Thoughts on this Question?
Hi @Anthony_Gilio I would need more info to help you out. "active" typically means a connected
Conversation in my view, is that what you mean? You mention "threaded state" but i'm not 100% clear on what you are asking. If you can give some more info on your use case and what you want, it might help.
Hi Greg, let me try to clarify. When an SMS is initiated, either inbound or outbound, a threading timeline determines the amount of time a messaging conversation remains open after the agent/system disconnects. I want to be able to find an SMS message via CallerID that is open (in the threading timeline).
Got it. There is not really a good event to check there, as it's a service runtime calculation. If we receive a new message from/to the same users, then the calculation is done at that instant in time to decide to thread the message or not.
So your question would be like "For this exact instant in time, how many of those conversations would thread, if there was a new message right then" It's just not something that is exposed today in any real manor. It doesn't mean that you yourself couldn't do the calculation though either. The logic would be something like this
GET the `disconnectedTime ` on the latest `customer` Communication for given Conversation (using the from/to recipients you wanted, you could search for conversations that match your criteria then filter by the latest one in the list)
long calculation = ChronoUnit.SECONDS.between(communication.getDisconnectedTime(), Instant.now());
if (calculation >= your threading timeline setting for your org and that messaging channel (sms in your case)) {
//new message would not thread, and instead start new conversation
} else {
//new message would thread on that same conversation
}
see this documentation for what a messaging communication is if you're not aware - messaging-apis
Thanks, Greg ugly but it makes sense.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.