I am currently working with the mail data in GraphAPI. I need to get the order of messages in a mail conversation. I have the Conversation Index of messages in the conversation.
How to get the position/order of messages using the Conversation Index ?
User 1 message converstionIndex : AQHXa/g7jienD/k6UUuD7h/+vh/4PQ==
User 2 message converstionIndex : AQHXa/g7jienD/k6UUuD7h/+vh/4PaspGJ7v
User 1 message converstionIndex : AQHXa/g7jienD/k6UUuD7h/+vh/4PaspGJ7vgAAARsM=
User 2 message converstionIndex : AQHXa/g7jienD/k6UUuD7h/+vh/4PaspGJ7vgAAARsOAAAA9xA==
User 1 message converstionIndex : AQHXa/g7jienD/k6UUuD7h/+vh/4PaspGJ7vgAAARsOAAAA9xIAAACfU
User 2 message converstionIndex : AQHXa/g7jienD/k6UUuD7h/+vh/4PaspGJ7vgAAARsOAAAA9xIAAACfUgAAAOmw= `
I can explain how this works in Outlook as the corresponding tag was added to the question.
The ConversationIndex property is a string that represents a hexadecimal number. Valid characters within the string include the numbers 0 through 9 and the letters A through F (uppercase or lowercase).
A conversation is a group of related messages that have the same ConversationTopic property value. In a discussion application, for example, users can save original messages and responses in their personal folders. Messages can be tagged with the ConversationIndex property so that users can order the messages within the conversation.
This convention uses concatenated time stamp values, with each new message in the conversation adding a new time stamp to the end of the ConversationIndex string. You can see time relationships among the messages when you sort them by ConversationIndex values.
For more information on conversations, see Working With Conversations.
Note, the Session object provides the CreateConversationIndex method to create or update a conversation index.
this is how:
private static getIsFirstMessageInConversation(conversationIndex?: string): boolean {
if (!conversationIndex) return false;
const FIRST_MESSAGE_IN_CONVERSATION_BYTES_LENGTH = 22;
return atob(conversationIndex).length === FIRST_MESSAGE_IN_CONVERSATION_BYTES_LENGTH;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With