can't find a way to list email replies - microsoft-graph-api

I am working on integration with Microsoft Graph and can't find a way to list all replies for specific email so the user can respond to it
we have implemented this idea on Gmail API through the thread concept
but in Microsoft Graph we found that the thread word has different use
I have found something in common between the original mail and its replies which is conversationId but it's impossible to get and filter all sent messages and also received ones to just find the mails have the same conversationId

I'm not sure where you got the idea that you can't filter on conversationId but it absolutely can be. The following will return any messages matching the conversation:
/v1.0/me/messages?$filter=conversationId eq '{conversationId}'
/v1.0/users/{id|userPrincipalName}/messages?$filter=conversationId eq '{conversationId}'

Related

Getting the attachments of an attached Message in Microsoft Graph

I'm trying to retrieve emails using Microsoft Graph(and the Microsoft Graph SDK) and i'm running into the following problem : when the email has another Outlook message attached to it and that message also has attachments, i'm unable to get them.
I'm able to retrieve the attached message with the following query, but I can't do a second expand on attachments as I'm already doing one to get the OutllokItem(message)
/v1.0/users/<UserName>/messages/<MessageId>/attachments/<AttachmentID>?$expand=microsoft.graph.itemattachment/item
Is this possible at all ? Thanks in advance.
For anyone looking for a solution, there's a feature currently available on beta only that allows you to get the whole message in Mime text format.
To get an attachment
/beta/users/<UserName>/messages/<MessageId>/attachments/<AttachmentID>/$value
To get the full initial message :
/beta/users/<UserName>/messages/<MessageId>/$value
See https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-beta&tabs=cs for details

Microsoft Graph email with a particular changeKey

I would like to know if there is a possibility of getting an email with a particular changeKey. I tried to do apply filtering on the changeKey but it did not work.
As clearly mentioned in the response ChangeKey does not support filtering with the current version of Microsoft Graph-Api. You need to find another approach here.

Get first email from conversation id using Microsoft Graph

Is it possible to query for the first, or all emails from a particular conversation id using the Microsoft Graph? If not, how about with the classic Exchange API?
Scenario: I am creating an application where I am interested in tracking the user who started an email thread, and the content of their initial message.
When querying for mail using the Microsoft Graph, I can get back an id unique to that email, and a conversationId unique to that email thread. The body returns the full email thread so far, but it is none trivial to parse (are there tips to parsing the returned HTML?), and may not always be accurate if people are adjusting the mail that gets sent back and forth.
Maybe the solution here is to parse the full body HTML, but I have not seen any documentation on best practices here. Any tips?
To get all mails with same conversationId, you can use
GET https://graph.microsoft.com/v1.0/me/messages?$filter= conversationId eq 'yourConversationId'
Microsoft Graph is using OData. So you can use query parameters to customize responses.
For how to use query, please check this document.

Slack API to query direct messages count between users

I'm trying to see if they is a way to use the slack API to query how many messages two users are sending
From the API documents I think it should be using https://api.slack.com/types/im but I'm unsure how to query it
Any help will be good
The API looks like, it's not supposed to return absolute information like the count of the messages. But with the im.history you can get all messages and just count them. But for long chats this has a big overhead of getting all these messages. Also there's a limit to the count of messages you can query, so you might have to query all iteratively.

Twitter Search API: Determining Conversations

Twitter's REST API returns a in_reply_to_status_id value for tweet statuses, yet the Search API does not.
What puzzles me is, if you search using the http://search.twitter.com/ webpage directly, tweets that are in reply to another tweet contain a "Show Conversation" link, but when searching using the API directly, there doesn't seem to be any data suggesting that a conversation exists (with JSON, at least).
How does this search page know which tweets are part of a conversation, and what would be the best way to emulate this behaviour (JSON preferred) in a rate-friendly way? I imagine I would have to do additional calls or something...?
related_results is officially dead along with the v1 API. It appears official Twitter apps use a call to /1.1/conversation/show.json?id=___ as mentioned here https://dev.twitter.com/discussions/17647 however it appears to be blocked from non-Twitter clients.
Just check the JSON field "to_user", which contains screen_name of the #replied person. If its null, you can assume its not a reply. You could also check, if the tweet string starts with a #username, which
http://search.twitter.com/search.json?q=%40aplusk
When you use the search.twitter.com, look for a field name in_reply_to_status_id This contains the original status_id to which this tweet was a reply. Next, there is a currently unsupported/undocument api call to get the whole conversation:
https://api.twitter.com/1/related_results/show/169145505824256000.json?include_entities=1
The value (169145505824256000) is the status_id you want to retrieve the conversation for.
An update on this as I was just faced with the same problem. The Twitter v1.1 API should now return valid in_reply_to_status_id values. But the unsupported v1 related_results has now gone forever.
You can see information about this, and some suggestions about using the streaming API, at https://dev.twitter.com/discussions/11292

Resources