A helper method to predictably compute a Conversation ID based on participants' ids in the given conversation. Use this method if you want to simply create a conversation between two users, not related to a particular product, order or transaction.
The order of the parameters does not matter.
Talk.oneOnOneId("a", "b") yields the same result as
This method takes the following steps:
In pseudocode, this is what this function does:
var sorted = [me.id, other.id].sort() var encoded = JSON.encode(sorted) var hash = sha1(encoded) return truncate(hash, 20)
For a PHP implementation, see https://gist.github.com/eteeselink/4dc3ad32cc478986ff2b5b6361a1825f. Get in touch if you need our help implementing this in your backend language.
Generated using TypeDoc